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

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

Open
rmmariano opened this issue May 17, 2021 · 1 comment
Open

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

rmmariano opened this issue May 17, 2021 · 1 comment

Comments

@rmmariano
Copy link

rmmariano commented May 17, 2021

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
Copy link
Member

rvagg commented May 18, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants