I just tried to install node
and npm
on Debian Stretch. I installed node like decribed here.
After installing nodejs-legacy
too I got the node
command working but npm
command still won't be found.
So, I tried to install it manually via apt-get install npm
but it just tells me that it can't find the package. Next I tried the "Fancy Install (Unix)" from npm repository which fails with
install npm@latest
fetching: https://registry.npmjs.org/npm/-/npm-5.5.1.tgz
module.js:327
throw err;
^
Error: Cannot find module '/tmp/npm.1272/package/bin/read-package-json.js'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:140:18)
at node.js:1043:3
added 1 package and removed 1 package in 0.45s
/usr/bin/npm -> /usr/lib/node_modules/npm/bin/npm-cli.js
/usr/bin/npx -> /usr/lib/node_modules/npm/bin/npx-cli.js
+ npm@5.5.1
updated 1 package in 1.21s
It worked
Although it creates the link for the npm
command the links are broken.
Does anyone an idea how I can get npm
running?
One more thing:
I have the visual studio code repositories in my sources.list which uses node too. Is it possible that that's a reason why it downloads a node package without npm when I do apt-get install -y nodejs
?
Thanks in advance for every answer.