npm bcrypt installation error when using travis - node.js

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.

Related

Installing node-sass errors with 'ELIFECYCLE'

I install npm and work, but I can not install node-sass. The next message following;
npm ERR! Linux 4.15.0-39-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "scss"
npm ERR! node v8.10.0
npm ERR! npm v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! one#1.0.0 scss: `node-sass -watch scss -o css`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the one#1.0.0 scss script 'node-sass -watch scss -o css'.
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 one package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-sass -watch scss -o css
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs one
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls one
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/maty/Desktop/MyFirstProyect/npm-debug.log
I install sass use;
npm install node-sass
sudo npm install -g sass
I checked the version, I made an easy sass code example.
Someone, could you help me?
Check your node version and node-sass version.
Mine was "node-sass":"4.5.3" node version i changed that too "node-sass":"^4.6.0"
(change this based on your node version by referring the below attached image) in package.json dev dependency and ran npm install. Installation was success and working fine.try this

node-pre-gyp err while trying to npm install

While trying to install sqlite I'm getting an error running with:
npm v6.4.1
node v8.11.4
Windows 10
I tried to clean cache, reinstall nodejs/npm and some random things I found in other questions here(like setting msvs version, setting python config var etc.)
Error log:
kawthar#Romana MINGW64 ~/Desktop/Nodev/Artesã (JS)
$ npm install sqlite --save
> sqlite3#4.0.2 install C:\Users\kawthar\Desktop\Nodev\Artesã (JS)\node_modules\sqlite3
> node-pre-gyp install --fallback-to-build
'node-pre-gyp' is not recognized as an internal or external command,
operable program or batch file.
npm WARN qi-bot#1.0.0 No description
npm WARN qi-bot#1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sqlite3#4.0.2 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sqlite3#4.0.2 install 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! C:\Users\kawthar\AppData\Roaming\npm-cache\_logs\2018-08-30T22_28_34_617Z-debug.log
Use the following command and try again:
npm install -g node-gyp

Deploying to App Engine generates error with gulp?

What I wrote in terminal to deploy as usual:
gcloud app deploy
The error I get:
Application startup error:
> meanjs#0.5.0 start /app
> gulp
sh: 1: gulp: not found
npm ERR! Linux 3.16.0-4-amd64
npm ERR! argv "/nodejs/bin/node" "/nodejs/bin/npm" "start"
npm ERR! node v6.9.5
npm ERR! npm v3.10.10
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! meanjs#0.5.0 start: `gulp`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the meanjs#0.5.0 start script 'gulp'.
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 meanjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! gulp
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs meanjs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls meanjs
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /app/npm-debug.log
Using Mean.js : https://github.com/meanjs/mean
Can't find the npm debug log.
P.S.: I did install gulp globally with
$ sudo npm install gulp-cli -g
First, you don't need to use sudo.
You can fix your error by typing this in terminal:
npm config set prefix ~/npm
# add this to your .bashrc (or .zshrc or whatever you are using)
export PATH="$PATH:$HOME/npm/bin"
Then re-install without sudo.
Hope this helps!
It seems that you did not install gulp in your server. Try to re-install gulp in your server with NodeJS and npm on your server and then install gulp with required packages it may resolve an error.
Please review an error you may find a solution
npm ERR! Make sure you have the latest version of node.js and npm
installed.
Install gulp in your project
npm install gulp
Install gulp globally.
npm install gulp -g
It was an issue with the NODE_ENV.
It would not find the gulp dependency in production, so I had to change my package.json and put everything in "dependencies" instead of using some in "dev_dependencies".

Npm: Cannot call method 'charAt' of undefined

On project we use travis
on my last PR i've got an error:
$ npm install
npm ERR! git clone --template=/home/travis/.npm/_git-remotes/_templates --mirror git://github.com/*****/***-global.git /home/travis/.npm/_git-remotes/git-github-com-****-***-global-git-1c65c4d0
npm ERR! Linux 3.13.0-40-generic
npm ERR! argv "node" "/home/travis/.nvm/v0.10.38/bin/npm" "install"
npm ERR! node v0.10.38
npm ERR! npm v2.7.4
npm ERR! Cannot call method 'charAt' of undefined
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /home/travis/build/*****/*****-auth/npm-debug.log
The command "npm install" failed and exited with 1 during .
At dev machine all works fine
I tried set source with git+https / git://
try to set the same node / npm version for travis
i even try to set
os:
- osx
The same
Can anyone help me?
It is fixed in npm version 2.7.5, as it is written in changelog https://github.com/npm/npm/blob/master/CHANGELOG.md, #7746 bug fix. Try to update npm.
This bug was fixed at npm 2.7.5
So my way to resolve problem was add to .travis.yml
before_install:
- "npm install -g npm#^2.7.5"

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)

Resources