Node.JS + CentOS + node-waf - node.js

I have installed Node.JS on CentOS from source like this:
yum install gcc-c++ make git
cd /usr/local/src/
git clone git://github.com/joyent/node.git
cd node
./configure
make
make install
yet while installing modules via npm I get error:
sh: node-waf: command not found
npm ERR! threads_a_gogo#0.1.5 install: `node-waf configure install`
npm ERR! `sh "-c" "node-waf configure install"` failed with 127
npm ERR!
npm ERR! Failed at the threads_a_gogo#0.1.5 install script.
npm ERR! This is most likely a problem with the threads_a_gogo package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-waf configure install
npm ERR! You can get their info via:
npm ERR! npm owner ls threads_a_gogo
npm ERR! There is likely additional logging output above.
is this issue CentOS related, or what is possibly going wrong? This link suggests that this error should only happen if Node is not installed from source....which in this case it is.

node-waf is deprecated and was removed from node 0.10: https://github.com/joyent/node/issues/3475.
You should open an issue with the package you are trying to use to get it updated to node-gyp.

Related

Plesk install npm packages Error

I created an API that use hummus.js modules. Localy tested -> Works fine.
Now I uploaded my API and try to run npm install to install all dependencies. But I got this Error:
npm-Installation
Execution filemng has failed with exit code 1, stdout:
> hummus#1.0.81 install /var/www/vhosts/XXX/XXX/node_modules/hummus
> node-pre-gyp install --fallback-to-build
, stderr: npm WARN lifecycle npm is using /opt/plesk/node/7/bin/node but there is no node binary in the current PATH. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
/usr/bin/env: 'node': No such file or directory
npm WARN XXX#0.0.1 No description
npm WARN XXX#0.0.1 No repository field.
npm WARN XXX#0.0.1 No license field.
npm ERR! Linux 4.4.0-21-generic
npm ERR! argv "/opt/plesk/node/7/bin/node" "/opt/plesk/node/7/bin/npm" "install"
npm ERR! node v7.4.0
npm ERR! npm v4.0.5
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! hummus#1.0.81 install: `node-pre-gyp install --fallback-to-build`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the hummus#1.0.81 install script 'node-pre-gyp install --fallback-to-build'.
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 hummus package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs hummus
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls hummus
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /var/www/vhosts/XXX/XXX/npm-debug.log
The Error come from the hummus-js package.
So I want to try install node-gyp ( npm install -g node-gyp ). But I don't know how? In Plesk I canno't install a single module. When I try it with ssh i got:
command NPM not found
I'm a Server-Admin-Noob so I'm happy for every Help!
Greetings
EDIT:
My Server = Ubuntu 16.04 LTS Server 64bit + Plesk Onyx
If I assumed correctly, it boils down to you not having Node installed on your other machine. SSH into the machine, then, for debian and ubuntu-based OS run
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
(assuming, again, that you wanted Node 8.x), then run
sudo apt-get install -y build-essential
and for CentOS and other enterprise Linux OS:
curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
sudo yum -y install nodejs
sudo yum install gcc-c++ make
Then try redoing what you did.

npm bcrypt installation error when using travis

I am getting a very strange error when I try to run Travis on my application after installing the bcrypt library. Everything installs and runs fine when on my local machine but when I try to use travis I get an error installing bcrypt from package.json. Anyone know how to fix this?
npm ERR! Linux 4.8.12-040812-generic
npm ERR! argv "/home/travis/.nvm/versions/node/v6.11.0/bin/node" "/home/travis/.nvm/versions/node/v6.11.0/bin/npm" "install"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! bcrypt#1.0.2 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt#1.0.2 install script 'node-pre-gyp install --fallback-to-build'.
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 bcrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs bcrypt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls bcrypt
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/travis/build/SamKirkiles/Teller/Server/npm-debug.log
The command "cd $TEST_DIR && npm install && npm test" exited with 1.
Done. Your build exited with 1.
Do you have your Travis Node.js configuration set up for compiling native modules?
Try adding this to your .travis.yml under the node_js setting (merge the env: bit together with any existing settings; you only need global: if you're building using a matrix e.g. testing on more than one Node version):
env:
global:
- CXX=g++-4.8
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
I extracted this from the Travis docs page linked above.
If that doesn't work, maybe try linking to your .travis.yml here so we can see more about your build process.

Ubuntu + Ember not working

I have node 0.12.0 installed, I installed it using NVM.
I have ember-cli installed, I have it using npm:
I installed it by:
sudo npm install -g ember-cli
Now though, when I try and run ember server on a brand new ember project, it makes me get 100s of modules, I have been doing it for about half an hour and using npm to install each module by hand. Is their a better way to do this, because this is a pain?
As well, I cant seem to get the node/debug module, so I am a bit stuck.
arie#arie-UX32VD:~/Desktop/programming/git/bostonember/ember$ sudo npm install debug/node
npm ERR! git clone git#github.com:debug/node Cloning into bare repository '/home/arie/.npm/_git-remotes/git-github-com-debug-node-65a3e6d9'...
npm ERR! git clone git#github.com:debug/node Permission denied (publickey).
npm ERR! git clone git#github.com:debug/node fatal: Could not read from remote repository.
npm ERR! git clone git#github.com:debug/node
npm ERR! git clone git#github.com:debug/node Please make sure you have the correct access rights
npm ERR! git clone git#github.com:debug/node and the repository exists.
npm ERR! addLocal Could not install debug/node
npm ERR! Error: ENOENT, stat 'debug/node'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Linux 3.16.0-34-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "debug/node"
npm ERR! cwd /home/arie/Desktop/programming/git/bostonember/ember
npm ERR! node -v v0.10.37
npm ERR! npm -v 1.4.28
npm ERR! path debug/node
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/arie/Desktop/programming/git/bostonember/ember/npm-debug.log
npm ERR! not ok code 0
You are getting confused because you have multiple versions of Node in your system. You installed it through nvm and probably you also have Node installed through apt-get, the later is the one that asks about sudo permissions, nvm would never do that.
sudo apt-get remove node
Completely remove node from your system and only use the binaries installed by nvm. You can verify that you are using the correct binaries with:
which node
expected output:
~/.nvm/v0.12.00/bin/node

Installing NodeJS contextify package yields an error

I am 1 hour into NodeJS, so bear with me. One of the packages my project requires is JSDom. After prodding much of the Internet I found that JSDOm has a dependency called contextify, which is somehow handled within the JSDom installation in itself. So this is what I Do:
sudo npm install jsdom
and everything goes fine, until I get the following:
gyp WARN install got an error, rolling back install
gyp ERR! rebuild error Error: EACCES, stat '/root/.node-gyp/0.8.2'
gyp ERR! not ok
npm ERR! contextify#0.1.7 install: `node-gyp rebuild`
npm ERR! `sh "-c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Failed at the contextify#0.1.7 install script.
npm ERR! This is most likely a problem with the contextify package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls contextify
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.2.0-60-generic
npm ERR! command "/opt/node/bin/node" "/opt/node/bin/npm" "install" "contextify"
npm ERR! cwd /opt/node
npm ERR! node -v v0.8.2
npm ERR! npm -v 1.1.36
npm ERR! code ELIFECYCLE
npm ERR! message contextify#0.1.7 install: `node-gyp rebuild`
npm ERR! message `sh "-c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /opt/node/npm-debug.log
npm ERR! not ok code 0
STUMPED!!!
I found that for contextify to run on Ubuntu, I must have make, python and G++. I have them all. So what exactly am I missing out here?
FYI, the commands preceding the JSDOM install attempt are:
mkdir ~/.node-gyp
chmod -R 777 ~/.node-gyp
I also, tried the following:
npm install -g node-gyp
npm install contextify
At the second command, I run into the same problem.
you might need to do
sudo npm install -g npm
and try again (it worked on my mac)
or see this Error installing contextify- node-gyp rebuild failed
if you did a standard apt-get on node it could well be behind the times and taking the latest bundle release might fix it
The situation has changed: jsdom >= 4.0.0 no longer uses contextify:
4.0.0
This release relies on the newly-overhauled vm module of io.js to eliminate the Contextify native module dependency. jsdom should now be much easier to use and install, without requiring a C++ compiler toolchain!
And if you need the old one without contextify, try jsdom-no-contextify.
The node-gyp EACCES can be solved by changing access and sometimes setting node-gyp python version for npm as follows:
sudo chown -R $USER /usr/local
and
npm config set python /usr/bin/python2.7
(Change python2.7 to python2.6 depending on which version is relevant)

npm install sqlite3 error

i am not sure why, but i am having issues while installing any of the packages using npm. i tried to install sqlite3 and it gave error as follows:
naphstor#ubuntu:~$ sudo npm install sqlite3
[sudo] password for naphstor:
> sqlite3#2.0.15 preinstall /home/naphstor/node_modules/sqlite3
> node-waf clean || true; node-waf configure build
Nothing to clean (project not configured)
Setting srcdir to : /home/naphstor/node_modules/sqlite3
Setting blddir to : /home/naphstor/node_modules/sqlite3/build
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for node path : not found
Checking for node prefix : ok /usr/local
Checking for sqlite3 : not found
Checking for library sqlite3 : not found
/home/naphstor/node_modules/sqlite3/wscript:29: error: the configuration failed (see '/home/naphstor/node_modules/sqlite3/build/config.log')
npm ERR! error installing sqlite3#2.0.15 Error: sqlite3#2.0.15 preinstall: `node-waf clean || true; node-waf configure build`
npm ERR! error installing sqlite3#2.0.15 `sh "-c" "node-waf clean || true; node-waf configure build"` failed with 1
npm ERR! error installing sqlite3#2.0.15 at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/exec.js:49:20)
npm ERR! error installing sqlite3#2.0.15 at ChildProcess.emit (events.js:70:17)
npm ERR! error installing sqlite3#2.0.15 at maybeExit (child_process.js:359:16)
npm ERR! error installing sqlite3#2.0.15 at Process.onexit (child_process.js:395:5)
npm ERR! sqlite3#2.0.15 preinstall: `node-waf clean || true; node-waf configure build`
npm ERR! `sh "-c" "node-waf clean || true; node-waf configure build"` failed with 1
npm ERR!
npm ERR! Failed at the sqlite3#2.0.15 preinstall script.
npm ERR! This is most likely a problem with the sqlite3 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-waf clean || true; node-waf configure build
npm ERR! You can get their info via:
npm ERR! npm owner ls sqlite3
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Linux 3.0.0-12-generic
npm ERR! command "node" "/usr/local/bin/npm" "install" "sqlite3"
npm ERR! cwd /home/naphstor
npm ERR! node -v v0.5.11-pre
npm ERR! npm -v 1.0.106
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/naphstor/npm-debug.log
npm not ok
naphstor#ubuntu:~$
any idea why is it like that. it shows same kind of error in installing any of the other packages.
I can do it with a workaround like "git clone git://github.com/developmentseed/node-sqlite3.git" but was wondering why npm gives error while installing any of these packages.
This can be fixed by forcing SQLite3 to compile.
npm install sqlite3 --build-from-source
Make sure you have these following dependencies installed
python-software-properties
python
g++
make
build-essential
or run sudo npm install -g node-gyp
You will find more informations there (SQlite3 section):
http://support.ghost.org/troubleshooting/
Node version can be the issue, so for node 10.x and later, just install sqlite3#4.1.1, as in specify the version
Try updating npm. I just tested it with the latest version, and it worked.
Alternatively, try one of these packages:
https://github.com/grumdrig/node-sqlite
https://github.com/orlandov/node-sqlite
I faced this problem as well then i removed node js what i downloaded and installed from ubuntu repos and downloaded source code from official node js site and compiled after it again tried to install sqlite without problem it worked i advise u to update your node and npm version as well
It was a permissions problem for me. I was seeing this line before the errors:
gyp WARN EACCES current user ("ubuntu") does not have permission to access the dev dir "/root/.cache/node-gyp/14.15.4"
So I did chmod -R 777 /root then npm i sqlite3.

Resources