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

Installation failed on ubuntu 14.04 node 6.9.1 npm 3.10.8 #99

Closed
viyatgandhi opened this issue Nov 2, 2016 · 3 comments
Closed

Installation failed on ubuntu 14.04 node 6.9.1 npm 3.10.8 #99

viyatgandhi opened this issue Nov 2, 2016 · 3 comments

Comments

@viyatgandhi
Copy link

I am trying to install using npm install sodium alerady have autoconf, libtool, automake, libsodium-dev, node-gyp installed on system.

log - https://gist.github.com/viyatgandhi/b3e028ed4cf41f4ce38154c058873e2c

../src/crypto_aead.cc:592:5: note: in expansion of macro ‘METHOD_AND_PROPS’
METHOD_AND_PROPS(chacha20poly1305_ietf);
^
make[1]: *** [Release/obj.target/sodium/src/crypto_aead.o] Error 1
make[1]: Leaving directory /usr/local/lib/node_modules/sodium/build' gyp ERR! build error gyp ERR! stack Error: make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Linux 3.13.0-100-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/sodium
gyp ERR! node -v v6.9.1
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
make: *** [nodesodium] Error 1
/usr/local/lib/node_modules/sodium/install.js:288
throw new Error(cmdLine + ' exited with code ' + code);
^

Error: make nodesodium exited with code 2
at ChildProcess. (/usr/local/lib/node_modules/sodium/install.js:288:19)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
npm ERR! Linux 3.13.0-100-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "sodium" "-g"
npm ERR! node v6.9.1
npm ERR! npm v3.10.8
npm ERR! code ELIFECYCLE

npm ERR! sodium@1.2.3 install: node install.js --install
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sodium@1.2.3 install script 'node install.js --install'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the sodium package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js --install
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs sodium
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls sodium
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /var/nodeapp/app/npm-debug.log

@LewdEwe-ErikWallace
Copy link

I tried installing the sodium module on a DigitalOcean server with Ubuntu 16.04 and it failed with a very similar or identical error as reported above by @viyatgandhi. There are a whole string errors, all about macro expansion as far as I can see.

Before the node-gyp build started there was also a warning about something else, but I don't know if it matters:

npm WARN lifecycle sodium@1.2.3~preinstall: cannot run in wd %s %s (wd=%s) sodium@1.2.3 node install.js --preinstall /home/test/server/node_modules/.staging/sodium-4fff6169

Here is a link to the console output from the entire node-gyp build:

https://gist.github.com/LewdEwe-ErikWallace/e85eef6ffa14d3a8e98401a05d89866d

@LewdEwe-ErikWallace
Copy link

I think I found a solution to this and it appears to be due to user permissions. I usually do my server admin by logging in as root with SSH keys. I eventually found these web pages:

npm/npm#3497
https://www.bountysource.com/issues/28871797-installing-latest-on-debian-problems-with-node-gyp

From these I tried the idea of using the --unsafe-perm flag and the sodium package seemed to install without problems. So my command usage was:

npm install sodium --save --unsafe-perm

@paixaop
Copy link
Owner

paixaop commented Dec 2, 2016

Thank you for posting the issue and solution!
I'll update the docs

@paixaop paixaop closed this as completed Dec 2, 2016
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

3 participants