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

Can't install using NodeJS' snap #73

Closed
NatoBoram opened this issue Apr 17, 2019 · 4 comments
Closed

Can't install using NodeJS' snap #73

NatoBoram opened this issue Apr 17, 2019 · 4 comments

Comments

@NatoBoram
Copy link

Versions

node --version
v11.14.0
npm --version
6.9.0

Operating System

OS: Ubuntu 18.04.2 LTS x86_64 
Kernel: 4.15.0-48-generic 
Uptime: 23 hours, 45 mins 
Packages: 2578 
Shell: bash 4.4.19 
Resolution: 1920x1080, 1920x1080, 1920x1080 
DE: Unity 
WM: GNOME Shell 
WM Theme: Adwaita 
Theme: Adwaita-dark [GTK2/3] 
Icons: Adwaita [GTK2/3] 
Terminal: vscode 
CPU: AMD Ryzen 3 1200 (4) @ 3.100GHz 
GPU: NVIDIA GeForce GTX 1050 
Memory: 5060MiB / 16039MiB 

Error

sudo npm i -g nw
/usr/local/bin/nw -> /usr/local/lib/node_modules/nw/bin/nw
npm WARN lifecycle The node binary used for scripts is /snap/bin/node but npm is using /snap/node/1935/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> nw@0.37.4 postinstall /usr/local/lib/node_modules/nw
> node scripts/install.js

2019/04/17 16:08:17.508260 cmd_run.go:876: WARNING: cannot create user data directory: cannot create "/nonexistent/snap/node/1935": mkdir /nonexistent: permission denied
cannot create user data directory: /nonexistent/snap/node/1935: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! nw@0.37.4 postinstall: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the nw@0.37.4 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/natoboram/.npm/_logs/2019-04-17T20_08_17_611Z-debug.log
@fe3dback
Copy link

same issue, some log

Steps to reproduce:

  • install clean ubuntu 19.04
  • install node via snap
node -v
v10.15.3
node                     10.15.3                     1793  10        nodesource✓       classic

npm -v
6.4.1
  • run script:
sudo npm install -g @vue/cli
19164 warn lifecycle The node binary used for scripts is /snap/bin/node but npm is using /snap/node/1793/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
19165 verbose lifecycle protobufjs@6.8.8~postinstall: unsafe-perm in lifecycle false
19166 verbose lifecycle protobufjs@6.8.8~postinstall: PATH: /snap/node/1793/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/usr/local/lib/node_modules/@vue/cli/node_modules/protobufjs/node_modules/.bin:/usr/local/lib/node_modules/@vue/cli/node_modules/.bin:/usr/local/lib/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
19167 verbose lifecycle protobufjs@6.8.8~postinstall: CWD: /usr/local/lib/node_modules/@vue/cli/node_modules/protobufjs
19168 silly lifecycle protobufjs@6.8.8~postinstall: Args: [ '-c', 'node scripts/postinstall' ]
19169 silly lifecycle protobufjs@6.8.8~postinstall: Returned: code: 1  signal: null
19170 info lifecycle protobufjs@6.8.8~postinstall: Failed to exec postinstall script
19171 timing action:postinstall Completed in 90ms
19172 verbose unlock done using /home/neo/.npm/_locks/staging-3a08f0df5026584d.lock for /usr/local/lib/node_modules/.staging
19173 timing stage:rollbackFailedOptional Completed in 781ms
19174 timing stage:runTopLevelLifecycles Completed in 11197ms
19175 warn vue-virtual-scroller@1.0.0-rc.2 requires a peer of vue@^2.5.21 but none is installed. You must install peer dependencies yourself.
19176 warn ts-node@8.1.0 requires a peer of typescript@>=2.0 but none is installed. You must install peer dependencies yourself.
19177 warn apollo-tracing@0.5.2 requires a peer of graphql@0.10.x - 14.1.x but none is installed. You must install peer dependencies yourself.
19178 warn vue-resize@0.4.5 requires a peer of vue@^2.3.0 but none is installed. You must install peer dependencies yourself.
19179 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.8 (node_modules/@vue/cli/node_modules/fsevents):
19180 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.8: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
19181 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS:    darwin
19181 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch:  any
19181 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS:   linux
19181 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
19182 verbose stack RangeError: Maximum call stack size exceeded
19182 verbose stack     at RegExp.test (<anonymous>)
19182 verbose stack     at isDepOptional (/snap/node/1793/lib/node_modules/npm/lib/install/deps.js:405:45)
19182 verbose stack     at failedDependency (/snap/node/1793/lib/node_modules/npm/lib/install/deps.js:414:9)
19182 verbose stack     at failedDependency (/snap/node/1793/lib/node_modules/npm/lib/install/deps.js:430:9)
19182 verbose stack     at failedDependency (/snap/node/1793/lib/node_modules/npm/lib/install/deps.js:430:9)
19182 verbose stack     at failedDependency (/snap/node/1793/lib/node_modules/npm/lib/install/deps.js:430:9)
19182 verbose stack     at failedDependency (/snap/node/1793/lib/node_modules/npm/lib/install/deps.js:430:9)
19182 verbose stack     at failedDependency (/snap/node/1793/lib/node_modules/npm/lib/install/deps.js:430:9)
19182 verbose stack     at failedDependency (/snap/node/1793/lib/node_modules/npm/lib/install/deps.js:430:9)
19182 verbose stack     at failedDependency (/snap/node/1793/lib/node_modules/npm/lib/install/deps.js:430:9)
19182 verbose stack     at failedDependency (/snap/node/1793/lib/node_modules/npm/lib/install/deps.js:430:9)
19182 verbose stack     at failedDependency (/snap/node/1793/lib/node_modules/npm/lib/install/deps.js:430:9)
19182 verbose stack     at failedDependency (/snap/node/1793/lib/node_modules/npm/lib/install/deps.js:430:9)
19182 verbose stack     at failedDependency (/snap/node/1793/lib/node_modules/npm/lib/install/deps.js:430:9)
19182 verbose stack     at failedDependency (/snap/node/1793/lib/node_modules/npm/lib/install/deps.js:430:9)
19182 verbose stack     at failedDependency (/snap/node/1793/lib/node_modules/npm/lib/install/deps.js:430:9)
19183 verbose cwd /home/neo/code/web-debug-vue-scheme-render
19184 verbose Linux 5.0.0-13-generic
19185 verbose argv "/snap/node/1793/bin/node" "/snap/node/1793/bin/npm" "install" "-g" "@vue/cli"
19186 verbose node v10.15.3
19187 verbose npm  v6.4.1
19188 error Maximum call stack size exceeded
19189 verbose exit [ 1, true ]

@jclark-line45
Copy link

jclark-line45 commented Dec 18, 2019

I was running into the same issue and was able to resolve by running the following:

npm config set scripts-prepend-node-path true

@austinzuffi
Copy link

ditched the snap. curled the repo and installed via apt. for anyone who just needs it to work

@brwajumaa
Copy link

it's late but the problem is snap permission install it via binary archived file
i had same issue and you can install via apt but it's old version also it's the tutorial for it.
https://github.com/nodejs/help/wiki/Installation

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

5 participants