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

Packages not recognizing the current version of node when installing form-js #1206

Closed
okaeiz opened this issue Jun 8, 2024 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@okaeiz
Copy link

okaeiz commented Jun 8, 2024

Describe the Bug

I am trying to npm install the packages and it is stated in the docs that the requirements are node 16 and npm 8. So I used nvm to change my node and npm version to the ones required. Now I use node -v and npm -v and their results are:

v16.20.2
8.19.4
But after running npm install, it seems like it still assumes my node is 12:

npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=16 || 14 >=14.17' },
npm WARN EBADENGINE   current: { node: 'v12.22.9', npm: '8.19.4' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>= 16' },
npm WARN EBADENGINE   current: { node: 'v12.22.9', npm: '8.19.4' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=14' },
npm WARN EBADENGINE   current: { node: 'v12.22.9', npm: '8.19.4' }
npm WARN EBADENGINE }

I have tried cleaning the cache after version switch:

npm cache clean --force
rm -rf node_modules
rm package-lock.json

I also tried ensuring the PATH environment variable is correctly set to use the nvm-installed version of Node:

export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" bash_completion

But still, even after reboot, it seems like there's something wrong. Here's the rest of the errors in case someone recognizes what is wrong:

npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=14' },
npm WARN EBADENGINE   current: { node: 'v12.22.9', npm: '8.19.4' }
npm WARN EBADENGINE }
npm WARN deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm WARN deprecated [email protected]: This package is no longer supported. Please use @npmcli/package-json instead.
npm WARN deprecated [email protected]: This package is no longer supported. Please use @npmcli/package-json instead.
npm WARN deprecated [email protected]: This package is no longer supported.
npm WARN deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm WARN deprecated [email protected]: This package is no longer supported.
npm WARN deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm WARN deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm WARN deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm WARN deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm WARN deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm WARN deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm WARN deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm WARN deprecated [email protected]: This package is no longer supported.
npm ERR! code 1
npm ERR! path /home/okaeiz/Camunda/form-js/node_modules/nx
npm ERR! command failed
npm ERR! command sh -c -- node ./bin/post-install
npm ERR! /home/okaeiz/Camunda/form-js/node_modules/nx/src/project-graph/project-graph.js:119
npm ERR!         ...(projectConfigurationsError?.errors ?? []),
npm ERR!                                        ^
npm ERR!
npm ERR! SyntaxError: Unexpected token '.'
npm ERR!     at wrapSafe (internal/modules/cjs/loader.js:915:16)
npm ERR!     at Module._compile (internal/modules/cjs/loader.js:963:27)
npm ERR!     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
npm ERR!     at Module.load (internal/modules/cjs/loader.js:863:32)
npm ERR!     at Function.Module._load (internal/modules/cjs/loader.js:708:14)
npm ERR!     at Module.require (internal/modules/cjs/loader.js:887:19)
npm ERR!     at require (internal/modules/cjs/helpers.js:74:18)
npm ERR!     at Object.<anonymous> (/home/okaeiz/Camunda/form-js/node_modules/nx/bin/post-install.js:3:25)
npm ERR!     at Module._compile (internal/modules/cjs/loader.js:999:30)
npm ERR!     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2024-06-06T08_08_02_495Z-debug-0.log

And the scary thing is, I have tested this in 3 machines and the issue persists.

Steps to Reproduce

  1. Clone the project
  2. cd into the directory
  3. run npm install
  4. see the errors above

Expected Behavior

I expect the packages to get installed by running npm install

Environment

  • OS: Ubuntu Server 22.04
  • Library version: [latest]
@okaeiz okaeiz added the bug Something isn't working label Jun 8, 2024
@okaeiz
Copy link
Author

okaeiz commented Jun 9, 2024

After countless hours of hairpulling effort, I found out that this is a connection problem. I tried to run npm install while connected to a proxy and the packages were installed successfully.

Regarding the deprecation warnings and the Node and npm incompatibility, I realized those were irrelevant errors and you can safely ignore them.

@okaeiz okaeiz closed this as completed Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant