-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Can't run npm
on node 18.12.1 on Linux
#45329
Comments
Can we try Also, is it possible to make a test code snippet? |
Got this too. Such issues do not occur on nvm or nodesource, only with archive downloaded directly from site. node --version is working npm only works with change above npx also needs a patch: - const cli = require('../lib/cli.js')
+ const cli = require('../lib/node_modules/npm/lib/cli.js')
...
- process.argv[1] = require.resolve('./npm-cli.js')
+ process.argv[1] = require.resolve('../lib/node_modules/npm/bin/npm-cli.js')
...
- const { definitions, shorthands } = require('../lib/utils/config/index.js')
+ const { definitions, shorthands } = require('../lib/node_modules/npm/lib/utils/config/index.js') |
Sorry, I am dumb fox, looks like false alert When I leave node binary archive in /home and rename it to
having it in /opt with root owner and 755 produces issues above. How should I set permissions correctly? |
I also have this issue |
Hello! I`m trying to deploy nodejs app on AWS ubuntu EC2 micro instance. I have Node 18.12.1. When I start from my local folder in the remote terminal - it works well. But when I run as a demon - node throws an error where I use an 'import' statament. When I reconfiged a package.json file - the app works well |
I have the same problem on a PC on Windows . After update Node version. Can any fixed this problem? |
I had the same issue running |
Yesterday I started to fix the problem.I found out - when Nodejs runs as a service (I used systemctl for running the one) then It doesn |
npm
on node 18.12.1 on Linux
I got a similar error when I imported bcrypt package.
|
I have the same problem attempting to build on Mac OS 13.01 |
I got the same error on the windows:
|
If anyone is trying to build using esbuild, i got error using that. Switched to aws-cdk Lambda stack which has esbuild in built, solved my issue. I guess it has something to do with the configration in the esbuild.config.js file |
I'll close this because this ultimately looks like an npm issue and those should be reported to npm, not here. Node bundles npm but doesn't maintain it. |
For anyone getting here and seeing the same error, I was also able to reproduce this, albeit accidentally. I'm using a Python script to download & extract node-v18.16.0-linux-x64.tar.xz to a temp directory ... and the contents of that temp directory are then copied to a final location via shutil.copytree(). Problem ended up being that the default for shutil.copytree() is to not preserve symbolic links ... which is why npm & npx failed to run (they're supposed to be links!). When downloading via wget & extracting via tar, with no interim directory or copying involved, symlinks were preserved, and npm & npx ran as expected. |
Version
18.12.1 (the archive downloaded directly from site)
Platform
Linux 5.15.0-52-generic #58-Ubuntu SMP Thu Oct 13 08:03:55 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
npm
What steps will reproduce the bug?
Only run
npm
.How often does it reproduce? Is there a required condition?
Every time.
What is the expected behavior?
What do you see instead?
Additional information
When I edit
node-v18.12.1-linux-x64/bin/npm
from:To:
The problem will be solved. But I don't how to make contribution, because I can't understand your source code.
The text was updated successfully, but these errors were encountered: