nodejs / snap

Node.js snap source and updater
MIT License
167 stars 38 forks source link

Node.js Snap does not include npm as a command automatically #10

Open rmmariano opened 3 years ago

rmmariano commented 3 years ago

I've installed Node by Snap. npm has been installed together, but I'm not able to use it as a simple npm command automatically, I need to use /snap/bin/npm instead.

I can create an alias manually, but I believe that the installation to do this automatically would be better.

I've used the following commands:

$ sudo snap install node --classic
node (14/stable) 14.17.0 from OpenJS Foundation (iojs✓) installed

$ node -v
nv14.17.0

$ npm -v
bash: /usr/local/bin/npm: No such file or directory

$ which node
/snap/bin/node

$ which npm
/snap/bin/npm

$ /snap/bin/npm -v
6.14.13

I'm using Ubuntu 18.04.5.

Thank you in advance.

rvagg commented 3 years ago

it sets up npm and yarn global aliases, you may have an older installation that is messing with your current shell instance, perhaps log out and log in again to try it out, snap does some funky stuff with your PATH.