Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected token . #450

Open
ct2034 opened this issue Nov 22, 2022 · 5 comments
Open

Unexpected token . #450

ct2034 opened this issue Nov 22, 2022 · 5 comments

Comments

@ct2034
Copy link

ct2034 commented Nov 22, 2022

I installed the tool with sudo npm install -g --unsafe-perm backport.
When I run backport, nothing happens.
When I run npx backport i get:

Unexpected token .

I created both config files according to https://github.com/sqren/backport/blob/main/docs/config-file-options.md

@sorenlouv
Copy link
Owner

Hey!

It could be related to you running with sudo. I'll try to see if I can reproduce.

@gigerdo
Copy link

gigerdo commented Dec 6, 2022

I just had the same problem. It was caused by accidentally using an old node version (12). Using node 16 fixed the problem.

@sorenlouv
Copy link
Owner

Ahh, interesting. Thanks for chiming in @gigerdo .
@ct2034 Is that perhaps the same problem you are running into?

@li-boxuan
Copy link

I was using node 8 and saw the same problem. Using node 16 fixed the problem.

@sorenlouv
Copy link
Owner

@li-boxuan Thanks for chiming in. I might be able to catch this and warn the user with something like:

import semver from 'semver';
import { engines } from './package';

const version = engines.node;
if (!semver.satisfies(process.version, version)) {
  console.log(`Required node version ${version} not satisfied with current version ${process.version}.`);
  process.exit(1);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants