node-pre-gyp err while trying to npm install - node.js

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

Related

Unable to Install expo-cli

Unable to perform npm install -g expo-cli
OS : MACOS
Tried running the command with sudo user
Getting below exception.
npm ERR! errno 1
npm ERR! libxmljs#0.19.7 install: `node-pre-gyp install --fallback-to-build --loglevel http`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the libxmljs#0.19.7 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! /var/root/.npm/_logs/2019-11-17T17_36_58_769Z-debug.log```
Try this: npm i -g expo-cli#3.5.0
I also had the same error with latest version of Expo, but 3.5.0 version installs without problem.

Error after running $ sudo npm install error is - Failed at the grpc#1.10.1 install script

I am running the hyperleder fabric IBM marble-blockchain example. After running
$ sudo npm install
I am getting an error:
npm ERR! grpc#1.10.1 install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the grpc#1.10.1 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! /home/kundankumar/.npm/_logs/2019-06-19T07_41_32_817Z-debug.log
try running npm rebuild. I had a similar error and it was because of some stale c++ object files that node was using

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.

mean stack yo generator gives error when creating a new app

I am using mac OSx yosemit and I have installed bitnami mean stack package.
when i want to create a new app using generator it gives an error about v8-debugger.
Here are steps;
1. sudo npm install -g yo
2. npm install -g generator-meanjs
3. mkdir test & cd test/
4. yo meanjs
this asks me some questions about app and then starts to install required packages. It end with following error
> v8-profiler#5.2.12 install /Users/tahir/Developer/mean_stack/yo_app/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/v8-profiler
> node-pre-gyp install --fallback-to-build
[v8-profiler] Success: "/Users/tahir/Developer/mean_stack/yo_app/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/v8-profiler/build/profiler/v5.2.12/node-v14-darwin-x64/profiler.node" is installed via remote
npm ERR! Darwin 14.5.0
npm ERR! argv "/Applications/meanstack-3.0.4-2/nodejs/bin/.node.bin" "/Applications/meanstack-3.0.4-2/nodejs/bin/npm" "install"
npm ERR! node v0.12.7
npm ERR! npm v2.11.2
npm ERR! code ELIFECYCLE
npm ERR! v8-debug#0.4.6 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the v8-debug#0.4.6 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! This is most likely a problem with the v8-debug 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 their info via:
npm ERR! npm owner ls v8-debug
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/tahir/Developer/mean_stack/yo_app/npm-debug.log
I can't figure out what is problem I referred to some solutions like a discussion here https://github.com/node-inspector/node-inspector/issues/662 but unable to solve this issue.
Thanks for your help!

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