rhysd / NyaoVim

Web-enhanced Extensible Neovim Frontend
Other
2.22k stars 57 forks source link

cannot install through npm #127

Closed latel closed 1 year ago

latel commented 6 years ago

electron-prebuilt@1.4.13 postinstall /usr/local/lib/node_modules/nyaovim/node_modules/electron-prebuilt node install.js

/usr/local/lib/node_modules/nyaovim/node_modules/electron-prebuilt/install.js:22 throw err ^

Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/nyaovim/node_modules/electron-prebuilt/.electron' npm verb lifecycle electron-prebuilt@1.4.13~postinstall: unsafe-perm in lifecycle false npm verb lifecycle electron-prebuilt@1.4.13~postinstall: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/usr/local/lib/node_modules/nyaovim/node_modules/electron-prebuilt/node_modules/.bin:/usr/local/lib/node_modules/nyaovim/node_modules/.bin:/usr/local/lib/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin npm verb lifecycle electron-prebuilt@1.4.13~postinstall: CWD: /usr/local/lib/node_modules/nyaovim/node_modules/electron-prebuilt npm info lifecycle electron-prebuilt@1.4.13~postinstall: Failed to exec postinstall script npm verb unlock done using /Users/kevinnwang/.npm/_locks/staging-3a08f0df5026584d.lock for /usr/local/lib/node_modules/.staging npm WARN flux@3.1.3 requires a peer of react@^15.0.2 || ^16.0.0-beta || ^16.0.0 but none is installed. You must install peer dependencies yourself.

npm verb stack Error: electron-prebuilt@1.4.13 postinstall: node install.js npm verb stack Exit status 1 npm verb stack at EventEmitter. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:280:16) npm verb stack at emitTwo (events.js:125:13) npm verb stack at EventEmitter.emit (events.js:213:7) npm verb stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) npm verb stack at emitTwo (events.js:125:13) npm verb stack at ChildProcess.emit (events.js:213:7) npm verb stack at maybeClose (internal/child_process.js:927:16) npm verb stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5) npm verb pkgid electron-prebuilt@1.4.13 npm verb cwd /Users/kevinnwang/codes/wzq npm verb Darwin 17.0.0 npm verb argv "/usr/local/Cellar/node/8.7.0/bin/node" "/usr/local/bin/npm" "install" "-g" "nyaovim" "--proxy=http://xxx.com:80" "--verbose" "--registry=http://xxx.com" npm verb node v8.7.0 npm verb npm v5.4.2 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! electron-prebuilt@1.4.13 postinstall: node install.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the electron-prebuilt@1.4.13 postinstall script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm verb exit [ 1, true ]

rhysd commented 6 years ago

You need sudo because your node_modules directory requires root privilege to access. electron-prebuilt package makes a directory and downloads Electron binary into it.

latel commented 6 years ago

@rhysd thank you for reply, but I was already using sudo sudo npm i -g nyaovim

rhysd commented 6 years ago

hm... ok.

This is a problem of 'electron' package ('electron-prebuilt' is a former name). Could you try following? Does it work?

$ sudo npm i -g electron
latel commented 6 years ago

@rhysd

sudo tnpm i -g electron
/usr/local/bin/electron -> /usr/local/lib/node_modules/electron/cli.js

> electron@1.7.9 postinstall /usr/local/lib/node_modules/electron
> node install.js

/usr/local/lib/node_modules/electron/install.js:48
  throw err
  ^

Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/electron/.electron'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron@1.7.9 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron@1.7.9 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

failed again 😂

rhysd commented 6 years ago

ahh... It's 'electron' package issue. Please file it at electron repo's issues page and mention this issue.

alexxmde-zz commented 6 years ago

sudo npm install -g nyaovim --unsafe-perm=true --allow-root

did it for me

neochar commented 6 years ago

Try to run command $ node. If you get command not found then run sudo apt install nodejs-legacy