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
SyntaxError: Unexpected token '??=' , Lerna Installation Failed #3854
Comments
I'm having the same problem installing Lerna with node, version 14.21.3 |
Hmm it seems that nx which lerna has a dependency on does no longer support node 14 versions see https://nx.dev/nx-api/workspace/documents/nx-nodejs-typescript-version-matrix . I think this could be the issue. Is the issue still there with node 16? |
@amorscher Yes issue persists in higher node version too. We have node version 17.x and error log is, root@ip-x-x-x-x:~# sudo yarn global add lerna
yarn global v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
error cmd-shim@6.0.1: The engine "node" is incompatible with this module. Expected version "^14.17.0 || ^16.13.0 || >=18.0.0". Got "17.9.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/global for documentation about this command. |
sudo yarn global add lerna --ignore-engines worked !! yarn global v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "lerna@7.3.0" with binaries:
- lerna
Done in 47.96s. |
Why do you use a 17 version? Could you go to either 16, 18 or 20? I think these versions are supported. Best is the current lts. I think we should adapt the node.engine constraint in the packacke.json. @fahslaj Maybe some of the core team can confirm? |
@amorscher We use Chef Super Market to install Node and it supports Node 17 as of now. https://supermarket.chef.io/cookbooks/nodejs/versions/10.1.15 https://github.com/sous-chefs/nodejs/blob/main/attributes/repo.rb#L4C58-L4C58 |
I am having the same issue. Node v14.21.3
Lerna 7.3.0 officially supports Node v14. I think you need to revert 0bbd74d and release that in a next major version otherwise this is a breaking change. |
@kirrg001 and others - We're sorry for this oversight in our package.json files, but lerna v7 does not support v14. The important reason why is that Node does not even support Node v14. In fact node v14 was end of life software (on 30th April 2023) 2 months before lerna v7 was first created. This means that it does not receive any updates or maintenance whatsoever, even if critical security vulnerabilities have been uncovered. I strongly encourage all folks here to keep up with the maintenance LTS version of Node at an absolute minimum. Currently the LTS version is v18 (v16 is already fully EOL too): https://github.com/nodejs/release#release-schedule We will fix our package.json files in a patch release shortly, and update the v7 release notes, and apologies again for letting this slip through the cracks. Again, though, you should be endeavouring to update your node version based on Node's own releases, not those of your tools such as lerna. |
When did you officially drop Node v14 support? 🤔 Could you please share how to use Lerna with Node v14? Which Lerna version can be used? Should be compatible with npm workspaces. We are running multiple versions in our build + development and I assume others do too. Lot's of products and packages still support Node v14. And this is not about dropping Node v14, it's about the communication. |
@kirrg001 I can't really summarize it any differently than my previous message. It was human error that we did not include a commit in v7 that removed v14 from the engines, and that would have then correspondingly shown up in the release notes. We are sorry for this, we know it was not communicated as we would have wanted. We have now merged #3861 which corrects this, and it is included in You should be able to use lerna v6 with node 14. I would, however, again recommend that you do not continue to use/maintain tools for EOL node versions. Sorry again for the confusion here folks! |
@JamesHenry You suggested to use Lerna v6 with Node v14 |
@kirrg001 and you've verified that you have nx@15.8.9 in your node_modules per the resolution of that issue? E.g. |
It's working with using overrides 👍 Thank you |
Current Behavior
SyntaxError: Unexpected token '??='
Lerna Installation Failed
Expected Behavior
Successful install of Lerna
Steps to Reproduce
sudo yarn global add lerna
Failure Logs / Configuration
node version: v14.21.3
Error logs:
yarn global v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[1/2] ⠄ @parcel/watcher
error /usr/local/share/.config/yarn/global/node_modules/nx: Command failed.
Exit code: 1
Command: node ./bin/post-install
Arguments:
Directory: /usr/local/share/.config/yarn/global/node_modules/nx
Output:
/usr/local/share/.config/yarn/global/node_modules/nx/src/project-graph/utils/normalize-project-nodes.js:77
targets[target].configurations ??= {};
^^^
SyntaxError: Unexpected token '??='
at wrapSafe (internal/modules/cjs/loader.js:1029:16)
at Module._compile (internal/modules/cjs/loader.js:1078:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
at Module.load (internal/modules/cjs/loader.js:979:32)
at Function.Module._load (internal/modules/cjs/loader.js:819:12)
at Module.require (internal/modules/cjs/loader.js:1003:19)
at require (internal/modules/cjs/helpers.js:107:18)
at Object. (/usr/local/share/.config/yarn/global/node_modules/nx/src/project-graph/build-project-graph.js:10:35)
at Module._compile (internal/modules/cjs/loader.js:1114:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
lerna.json
<!-- Please paste your `lerna.json` here -->
lerna-debug.log
Environment
The text was updated successfully, but these errors were encountered: