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

npm fails to install @vue/cli #777

Closed
izznogooood opened this issue Jan 3, 2019 · 5 comments
Closed

npm fails to install @vue/cli #777

izznogooood opened this issue Jan 3, 2019 · 5 comments

Comments

@izznogooood
Copy link

anders@yoga:~/dev$ sudo npm install -g @vue/cli
npm WARN deprecated cross-spawn-async@2.2.5: cross-spawn no longer requires a build toolchain, use it instead
/usr/local/bin/vue -> /usr/local/lib/node_modules/@vue/cli/bin/vue.js
npm WARN lifecycle The node binary used for scripts is /snap/bin/node but npm is using /snap/node/1426/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> protobufjs@6.8.8 postinstall /usr/local/lib/node_modules/@vue/cli/node_modules/protobufjs
> node scripts/postinstall

2019/01/03 23:37:51.453025 cmd_run.go:835: WARNING: cannot create user data directory: cannot create "/nonexistent/snap/node/1426": mkdir /nonexistent: permission denied
cannot create user data directory: /nonexistent/snap/node/1426: Permission denied
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/@vue/cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! protobufjs@6.8.8 postinstall: `node scripts/postinstall`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the protobufjs@6.8.8 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/anders/.npm/_logs/2019-01-03T22_37_52_173Z-debug.log

@izznogooood izznogooood changed the title npm to install @vue/cli npm fails to install @vue/cli Jan 3, 2019
@chrislea
Copy link
Contributor

chrislea commented Jan 4, 2019

We just package up npm as it comes bundled with Node, we don't develop it or support it. I think you'll probably need to open up an issue with the Npm folks to see what's going on. Hope this helps!

@chrislea chrislea closed this as completed Jan 4, 2019
@izznogooood
Copy link
Author

I get that, but this problem is snap specific. It does not happen when I install node from the Repo's.
Do with the information as you like ;)

@chrislea
Copy link
Contributor

chrislea commented Jan 4, 2019

Yes, but again, that's why I think this is an issue for Npm. IIRC, the npm command does a number of things to try and figure out where to put stuff when you install a package. For example, if it's a local install, it figures out where your home directory is and where you're installing to, and makes decisions based on that.

In the case of a -g global install, I think it tries to figure out where the node binary is, and then tries to install files parallel to that (please don't hold me to this, it's been a long time since I've looked at it, and I've never worked on npm directly). So for example, our deb packages install it to /usr/bin, and a global npm install command will try to put things under /usr/lib in that case. This works as long as you have root or sudo permissions to let you write files there.

However, this will fail for a snap package as that's not how SquashFS (part of the packaging format for snaps) works since it's a read-only filesystem. So I think for this to do what you expect, npm would need to be aware that node is installed as part of a snap package, and make some new decision about where to put files based on that information. So I think this one is for the Npm folks, not us.

@florinutz
Copy link

florinutz commented Dec 17, 2019

in the meantime, your node snap is unusable. Maybe you could warn people with something like "snap is broken, we're waiting on npm to adapt their stuff to our stuff"

@erreur404
Copy link

I managed to install it by installing yarn first, and then use it to install vue cli :

sudo npm install -g yarn
yarn global add @vue/cli

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

4 participants