I have a problem installing package in node.js. My version of npm is 2.14.3 and I need to install sqlite3 package.
In my proyect path Im usign this command: "npm install sqlite3 --save" I have the next error:
npm WARN package.json node-sqlite#1.0.1 No description npm WARN
package.json node-sqlite#1.0.1 No repository field. npm WARN
package.json node-sqlite#1.0.1 No README data npm WARN package.json
node-sqlite#1.0.1 No license field. /
sqlite3#3.1.8 install /home/pi/Desktop/node-sqlite_Sockets/node_modules/sqlite3
node-pre-gyp install --fallback-to-build node-pre-gyp ERR! Tried to download(403):
https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.8/node-v46-linux-arm.tar.gz node-pre-gyp ERR! Pre-built binaries not found for sqlite3#3.1.8 and
node#4.1.0 (node-v46 ABI) (falling back to source compile with
node-gyp) make: Entering directory
'/home/pi/Desktop/node-sqlite_Sockets/node_modules/sqlite3/build'
ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep
Release/obj/gen/sqlite-autoconf-3150000/sqlite3.c TOUCH
Release/obj.target/deps/action_before_build.stamp CC(target)
Release/obj.target/sqlite3/gen/sqlite-autoconf-3150000/sqlite3.o
Release/obj/gen/sqlite-autoconf-3150000/sqlite3.c:199451:1: fatal
error: opening dependency file
./Release/.deps/Release/obj.target/sqlite3/gen/sqlite-autoconf-3150000/sqlite3.o.d.raw:
No such file or directory compilation terminated.
deps/sqlite3.target.mk:120: recipe for target
'Release/obj.target/sqlite3/gen/sqlite-autoconf-3150000/sqlite3.o'
failed make: ***
[Release/obj.target/sqlite3/gen/sqlite-autoconf-3150000/sqlite3.o]
Error 1 make: Leaving directory
'/home/pi/Desktop/node-sqlite_Sockets/node_modules/sqlite3/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:270:23)
gyp ERR! stack at emitTwo (events.js:87:13) gyp ERR! stack at
ChildProcess.emit (events.js:172:7) gyp ERR! stack at
Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.4.21-v7+ gyp ERR! command
"/usr/local/bin/node"
"/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js"
"build" "--fallback-to-build"
"--module=/home/pi/Desktop/node-sqlite_Sockets/node_modules/sqlite3/lib/binding/node-v46-linux-arm/node_sqlite3.node"
"--module_name=node_sqlite3"
"--module_path=/home/pi/Desktop/node-sqlite_Sockets/node_modules/sqlite3/lib/binding/node-v46-linux-arm"
gyp ERR! cwd /home/pi/Desktop/node-sqlite_Sockets/node_modules/sqlite3
gyp ERR! node -v v4.1.0 gyp ERR! node-gyp -v v3.0.3 gyp ERR! not ok
node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed
to execute '/usr/local/bin/node
/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js
build --fallback-to-build
--module=/home/pi/Desktop/node-sqlite_Sockets/node_modules/sqlite3/lib/binding/node-v46-linux-arm/node_sqlite3.node
--module_name=node_sqlite3 --module_path=/home/pi/Desktop/node-sqlite_Sockets/node_modules/sqlite3/lib/binding/node-v46-linux-arm'
(1) node-pre-gyp ERR! stack at ChildProcess.
(/home/pi/Desktop/node-sqlite_Sockets/node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:87:13) node-pre-gyp
ERR! stack at ChildProcess.emit (events.js:172:7) node-pre-gyp
ERR! stack at maybeClose (internal/child_process.js:817:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit
(internal/child_process.js:211:5) node-pre-gyp ERR! System Linux
4.4.21-v7+ node-pre-gyp ERR! command "/usr/local/bin/node" "/home/pi/Desktop/node-sqlite_Sockets/node_modules/sqlite3/node_modules/.bin/node-pre-gyp"
"install" "--fallback-to-build" node-pre-gyp ERR! cwd
/home/pi/Desktop/node-sqlite_Sockets/node_modules/sqlite3 node-pre-gyp
ERR! node -v v4.1.0 node-pre-gyp ERR! node-pre-gyp -v v0.6.31
node-pre-gyp ERR! not ok Failed to execute '/usr/local/bin/node
/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js
build --fallback-to-build
--module=/home/pi/Desktop/node-sqlite_Sockets/node_modules/sqlite3/lib/binding/node-v46-linux-arm/node_sqlite3.node
--module_name=node_sqlite3 --module_path=/home/pi/Desktop/node-sqlite_Sockets/node_modules/sqlite3/lib/binding/node-v46-linux-arm'
(1) npm ERR! Linux 4.4.21-v7+ npm ERR! argv "/usr/local/bin/node"
"/usr/local/bin/npm" "install" "sqlite3" "--save" npm ERR! node v4.1.0
npm ERR! npm v2.14.3 npm ERR! code ELIFECYCLE npm ERR! sqlite3#3.1.8
install: node-pre-gyp install --fallback-to-build npm ERR! Exit
status 1 npm ERR! npm ERR! Failed at the sqlite3#3.1.8 install script
'node-pre-gyp install --fallback-to-build'. 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-pre-gyp install --fallback-to-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! Please include the
following file with any support request: npm ERR!
/home/pi/Desktop/node-sqlite_Sockets/npm-debug.log
If I try to execute my node.js program I have the next error:
module.js:338 throw err; ^ Error: Cannot find module
'/home/pi/Desktop/node-sqlite_Sockets/node_modules/sqlite3/lib/binding/node-v46-linux-arm/node_sqlite3.node'
at Function.Module._resolveFilename (module.js:336:15) at
Function.Module._load (module.js:286:25) at Module.require
(module.js:365:17) at require (module.js:384:17) at Object.
(/home/pi/Desktop/node-sqlite_Sockets/node_modules/sqlite3/lib/sqlite3.js:4:15)
at Module._compile (module.js:434:26) at Object.Module._extensions..js
(module.js:452:10) at Module.load (module.js:355:32) at
Function.Module._load (module.js:310:12) at Module.require
(module.js:365:17)
After update (npm install -g npm)
npm WARN checkPermissions Missing write access to
/usr/local/lib/node_modules/npm
npm WARN checkPermissions Missing write access to
/usr/local/lib/node_modules
/usr/local/lib
└── npm#3.10.9
npm ERR! Linux 4.4.21-v7+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/ npm" "install"
"-g" "npm" npm ERR! node v4.1.0 npm ERR! npm v3.10.9 npm ERR! path
/usr/local/lib/node_modules/npm
npm ERR! code EACCES npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access
'/usr/local/lib/node_modules/npm' npm ERR! at Error (native) npm
ERR! { [Error: EACCES: permission denied, access
'/usr/local/lib/node_modules/npm'] npm ERR! errno: -13, npm ERR!
code: 'EACCES', npm ERR! syscall: 'access', npm ERR! path:
'/usr/local/lib/node_modules/npm' } npm ERR! npm ERR! Please try
running this command again as root/Administrator. npm ERR! Please
include the following file with any support request: npm ERR!
/home/pi/Desktop/node-sqlite_Sockets/npm-debug.log
Somebody know how to solve it?
Thanks in advance!
Best regards.
have you installed sqlite3 before on another app? because your cached files could be corrupt. try to remove it from your cache with npm cache clean sqlite3 or clean your whole cache with npm cache clean and run the install script again.
Edit: after you edited your question. it seems to be a permission error. Try running the npm update with sudo npm install -g npm
Summary: It was a problem with an old npm version. The update to a newer version solved it by running sudo npm install -g npm.
This worked for me on Windows 10.
npm uninstall sqlite3
npm cache clean
npm install sqlite3
None of the answers in different stackoverflow threads worked for me.
I deleted the cache, deleted the lock file, installed another version of Node, updated NPM, etc., but none of them worked. Maybe my answer is off-topic, But if you just want to get the job done right now, you may be able to install the package you want with another tool like yarn:
yarn add <package>
is equivalent to
npm i --save <package>
For example, SQLite3 and Sequelize could not be installed on my computer with NPM, which I could install with Yarn.
This worked for me:
Previously app directory was /My Files/TestApp and it always threw that error.
According to a suggestion on https://github.com/mapbox/node-sqlite3/issues/1538, I moved the directory to another directory that doesn't have spaces in the path (/FolderNameWithoutSpaces/TestApp)
And it worked
macOS Monterey v12.1
node version: v17.3.1
npm version: v8.3.0
This may not be the exact answer to the above question, but for some people, it will work.
On linux you should check that you have python installed python --version, if not, you should check this https://stackoverflow.com/a/46245617/9477206
Edit on 2022 : Please check the supported version of Node in sqlite npm documentation and use the supported Node version (mostly by downgrading using nvm)
For me the node verion is v16.x whereas the Sqlite max supported version is v12.x, so I downgraded and the issues went off!
This worked for me:
First, I had Visual C++ 2013 installed, then configured globally by running
npm config set msvs_version 2013 --global
Then I ran an installation of node-gyp by running npm install node-gyp -g node-gyp
Finally, I installed Sqlite3 by running npm install sqlite3
Hope this helps someone as it had helped me
Related
Trying to install firebase-tool for CLI. Getting failures.
running on macOS
I have seen suggestions like the following ...
Troubling with installing firebase-tools
I tried $ sudo npm install -g firebase-tools
Using 'sudo' gets past the error issues trying to access directories. but still crashes
The troubling bit seems to be this
node-pre-gyp ERR! Tried to download(undefined): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.4.1/node-v57-darwin-x64.tar.gz
I can put the above URL in a browser and it will download the tar.
I also have access problem even if I use 'sudo'
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/firebase-tools/node_modules/grpc/build'
Trying to understand how to get past the errors to install firebase-tools, Also some suggestions say to install node via nvm. Found tutorial on nvm, anyone know what doing this install will to to projects I already have on my machine. e.g confusion finding correct node.js, or need to reinstall everything that I already installed using my current node install?
The full error messages are ...
sudo npm install -g firebase-tools
Password:
npm WARN deprecated node-uuid#1.4.8: Use uuid module instead
/usr/local/bin/firebase -> /usr/local/lib/node_modules/firebase- tools/bin/firebase
> grpc#1.4.1 install /usr/local/lib/node_modules/firebase- tools/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library
node-pre-gyp ERR! Tried to download(undefined): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.4.1/node- v57-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for grpc#1.4.1 and node#8.9.4 (node-v57 ABI) (falling back to source compile with node-gyp)
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/firebase-tools/node_modules/grpc/build'
gyp ERR! System Darwin 17.3.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--library=static_library" "-- module=/usr/local/lib/node_modules/firebase- tools/node_modules/grpc/src/node/extension_binary/grpc_node.node" "-- module_name=grpc_node" "--module_path=/usr/local/lib/node_modules/firebase-tools/node_modules/grpc/src/node/extension_binary"
gyp ERR! cwd /usr/local/lib/node_modules/firebase-tools/node_modules/grpc
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --library=static_library -- module=/usr/local/lib/node_modules/firebase- tools/node_modules/grpc/src/node/extension_binary/grpc_node.node -- module_name=grpc_node --module_path=/usr/local/lib/node_modules/firebase- tools/node_modules/grpc/src/node/extension_binary' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/firebase-tools/node_modules/grpc/node_modules/node- pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:126:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:214:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:925:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
node-pre-gyp ERR! System Darwin 17.3.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/firebase- tools/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback- to-build" "--library=static_library"
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/firebase- tools/node_modules/grpc
node-pre-gyp ERR! node -v v8.9.4
node-pre-gyp ERR! node-pre-gyp -v v0.6.36
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --library=static_library -- module=/usr/local/lib/node_modules/firebase- tools/node_modules/grpc/src/node/extension_binary/grpc_node.node -- module_name=grpc_node --module_path=/usr/local/lib/node_modules/firebase- tools/node_modules/grpc/src/node/extension_binary' (1)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: grpc#1.4.1 (node_modules/firebase-tools/node_modules/grpc):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: grpc#1.4.1 install: `node- pre-gyp install --fallback-to-build --library=static_library`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
+ firebase-tools#3.17.4
added 8 packages and updated 1 package in 37.194s
I also tried to cd in to the node_modules directory and run the install from there as proposed in this post
firebase-tools cannot install, why?
The result is pages and pages of warning messages and finally an error
npm ERR! path /usr/local/lib/node_modules/firebase-tools/bin/firebase
npm ERR! code ELOOP
npm ERR! errno -62
npm ERR! syscall chmod
npm ERR! ELOOP: too many symbolic links encountered, chmod '/usr/local/lib/node_modules/firebase-tools/bin/firebase'
npm install -g firebase-tools
works on windows without causing any error. but when it comes to Mac you need to start it with sudo.
so the command will be:
sudo npm install -g firebase-tools
then check the version using firebase -V on terminal to make sure you've done correctly.
I encountered the same problem what I did was made sure I was in root directory and the ran :
sudo npm i g firebase-tools
Or in Windows
npm i g firebase-tools
I was constantly doing it in my project folder and kept getting the same error.
I had the same problem on macOS High Sierra. The only thing that worked for me in the end was to uninstall node.js from Homebrew (brew uninstall node), then install node.js using the downloadable installer (https://nodejs.org/en/download/) then install the Firebase CLI using sudo:
sudo npm install -g firebase-tools
After that, I still received the warnings, but could launch and configure Firebase. Not an ideal solution, but it is serving as a fix for me at the moment.
sudo npm install -g firebase-tools
sudo worked for me!
Without sudo I was getting the following error:
Lewis-MacBook-Pro:demo-firebase-func leg$ npm install -g firebase-tools
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! { Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! stack: 'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules' }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/leg/.npm/_logs/2018-10-03T20_35_51_209Z-debug.log
Installing Node from the package on its website, rather than through Brew, solved this issue for me.
In my case I had a corrupted Firebase install, solved by running:
curl -sL firebase.tools | upgrade=true bash
If you don't have Firebase already you can just run:
curl -sL firebase.tools
Reference: https://firebase.google.com/docs/cli#mac-linux-auto-script
I've installed node.js v6.9.1 together with npm version 4.1.2 and I've already used this combination for some projects
Now I wanted to use the bcrypt npm package in my project, but the installation fails miserably
npm install bcrypt --save
I've also tried to run this command with admin priviledges, to no avail
This is the error I get
> bcrypt#1.0.2 install C:\Users\ttheiner\NodeProjects\authtest\node_modules\bcry
pt
> node-pre-gyp install --fallback-to-build
node-pre-gyp ERR! Tried to download(404): https://github.com/kelektiv/node.bcryp
t.js/releases/download/v1.0.2/bcrypt_lib-v1.0.2-node-v48-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for bcrypt#1.0.2 and node#6.9.1 (
node-v48 ABI) (falling back to source compile with node-gyp)
C:\Users\ttheiner\NodeProjects\authtest\node_modules\bcrypt>if not defined npm_c
onfig_node_gyp (node "C:\Users\ttheiner\AppData\Roaming\npm\node_modules\npm\bin
\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" clean ) else (node
"" clean )
C:\Users\ttheiner\NodeProjects\authtest\node_modules\bcrypt>if not defined npm_c
onfig_node_gyp (node "C:\Users\ttheiner\AppData\Roaming\npm\node_modules\npm\bin
\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" configure --fallback
-to-build --module=C:\Users\ttheiner\NodeProjects\authtest\node_modules\bcrypt\l
ib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\Users\tthei
ner\NodeProjects\authtest\node_modules\bcrypt\lib\binding ) else (node "" confi
gure --fallback-to-build --module=C:\Users\ttheiner\NodeProjects\authtest\node_m
odules\bcrypt\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path
=C:\Users\ttheiner\NodeProjects\authtest\node_modules\bcrypt\lib\binding )
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT
HON env variable.
gyp ERR! stack at Object.failNoPython (C:\Users\ttheiner\AppData\Roaming\npm
\node_modules\npm\node_modules\node-gyp\lib\configure.js:454:19)
gyp ERR! stack at Object.<anonymous> (C:\Users\ttheiner\AppData\Roaming\npm\
node_modules\npm\node_modules\node-gyp\lib\configure.js:480:16)
gyp ERR! stack at C:\Users\ttheiner\AppData\Roaming\npm\node_modules\npm\nod
e_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:123:15)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ttheiner\\App
Data\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js"
"configure" "--fallback-to-build" "--module=C:\\Users\\ttheiner\\NodeProjects\\
authtest\\node_modules\\bcrypt\\lib\\binding\\bcrypt_lib.node" "--module_name=bc
rypt_lib" "--module_path=C:\\Users\\ttheiner\\NodeProjects\\authtest\\node_modul
es\\bcrypt\\lib\\binding"
gyp ERR! cwd C:\Users\ttheiner\NodeProjects\authtest\node_modules\bcrypt
gyp ERR! node -v v6.9.1
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp.cmd configure --fallb
ack-to-build --module=C:\Users\ttheiner\NodeProjects\authtest\node_modules\bcryp
t\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\Users\tt
heiner\NodeProjects\authtest\node_modules\bcrypt\lib\binding' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:\Users\ttheiner\NodeP
rojects\authtest\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:191:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:877:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/chi
ld_process.js:226:5)
node-pre-gyp ERR! System Windows_NT 6.1.7601
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\tthe
iner\\NodeProjects\\authtest\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "in
stall" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\ttheiner\NodeProjects\authtest\node_modules\bcryp
t
node-pre-gyp ERR! node -v v6.9.1
node-pre-gyp ERR! node-pre-gyp -v v0.6.32
node-pre-gyp ERR! not ok
Failed to execute 'node-gyp.cmd configure --fallback-to-build --module=C:\Users\
ttheiner\NodeProjects\authtest\node_modules\bcrypt\lib\binding\bcrypt_lib.node -
-module_name=bcrypt_lib --module_path=C:\Users\ttheiner\NodeProjects\authtest\no
de_modules\bcrypt\lib\binding' (1)
npm WARN authtest#1.0.0 No repository field.
npm WARN authtest#1.0.0 No license field.
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ttheiner\\AppDat
a\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "bcrypt" "--save"
npm ERR! node v6.9.1
npm ERR! npm v4.1.2
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 --fallb
ack-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! C:\Users\ttheiner\NodeProjects\authtest\npm-debug.log
The problem seems to be that npm cannot find pre-built binaries so it tries to compile the sources using python (which I don't seem to have).
Do I need to install python for this? If yes, can you point me in the right direction? Is it true that there is no pre-built version of bcrypt?
EDIT: After installing Python 2.7 the error changes... seems like it tries to use MSBuild to compile some C++ code.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(366,5): warning MSB8003: Could not find WindowsSDKDir var
iable from the registry. TargetFrameworkVersion or PlatformToolset may be set to an invalid version number. [C:\Users\ttheiner\NodeProject
s\authtest\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
TRACKER : error TRK0005: Failed to locate: "CL.exe". The system cannot find the file specified. [C:\Users\ttheiner\NodeProjects\authtest\no
de_modules\bcrypt\build\bcrypt_lib.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\ttheiner\AppData\Roaming\npm\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 Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ttheiner\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gy
p\\bin\\node-gyp.js" "build" "--fallback-to-build" "--module=C:\\Users\\ttheiner\\NodeProjects\\authtest\\node_modules\\bcrypt\\lib\\binding
\\bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=C:\\Users\\ttheiner\\NodeProjects\\authtest\\node_modules\\bcrypt\\lib\\binding
"
gyp ERR! cwd C:\Users\ttheiner\NodeProjects\authtest\node_modules\bcrypt
gyp ERR! node -v v6.9.1
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp.cmd build --fallback-to-build --module=C:\Users\ttheiner\NodeProjects\authtest\no
de_modules\bcrypt\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\Users\ttheiner\NodeProjects\authtest\node_modules\bc
rypt\lib\binding' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:\Users\ttheiner\NodeProjects\authtest\node_modules\node-pre-gyp\lib\util\compile.
js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:191:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:877:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp ERR! System Windows_NT 6.1.7601
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ttheiner\\NodeProjects\\authtest\\node_modules\\node-pre-gyp\\bi
n\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\ttheiner\NodeProjects\authtest\node_modules\bcrypt
node-pre-gyp ERR! node -v v6.9.1
node-pre-gyp ERR! node-pre-gyp -v v0.6.32
node-pre-gyp ERR! not ok
Failed to execute 'node-gyp.cmd build --fallback-to-build --module=C:\Users\ttheiner\NodeProjects\authtest\node_modules\bcrypt\lib\binding\b
crypt_lib.node --module_name=bcrypt_lib --module_path=C:\Users\ttheiner\NodeProjects\authtest\node_modules\bcrypt\lib\binding' (1)
npm WARN authtest#1.0.0 No repository field.
npm WARN authtest#1.0.0 No license field.
npm WARN Error: EPERM: operation not permitted, scandir 'C:\Users\ttheiner\NodeProjects\authtest\node_modules\dashdash\node_modules'
npm WARN at Error (native)
npm WARN { Error: EPERM: operation not permitted, scandir 'C:\Users\ttheiner\NodeProjects\authtest\node_modules\dashdash\node_modules'
npm WARN at Error (native)
npm WARN errno: -4048,
npm WARN code: 'EPERM',
npm WARN syscall: 'scandir',
npm WARN path: 'C:\\Users\\ttheiner\\NodeProjects\\authtest\\node_modules\\dashdash\\node_modules' }
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ttheiner\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "instal
l" "bcrypt" "--save"
npm ERR! node v6.9.1
npm ERR! npm v4.1.2
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! C:\Users\ttheiner\NodeProjects\authtest\npm-debug.log
I would suggest you use bcrypt-nodejs:
https://www.npmjs.com/package/bcrypt-nodejs
It provides almost the same functionality with easy usage.
Original answer:
Can you try the following:
Install Python (http://www.python.org/download/releases/2.7.5/)
Install Visual Studio 2012/13 Express (or other)
Install Windows SDK (for Windows 7 / 8)
Install Win64 OpenSSL v1.0.1g
Open "Developer Command Prompt for VS2012" as Administrator and test install
Then:
npm install node-gyp -g
npm install bcrypt -g
I've had the same or at least a similar error.
Running the following before trying to install bcrypt solved it for me:
npm install --global --production windows-build-tools
I also faced the same issue today whilst trying to install bcrypt on Windows 10 desktop. Turns out that bcrypt support stable versions of node better check out the docs
The solution for me was:
Upgrade node to a stable version: I manually downloaded and installed Windows installer from Node website.
Install the Windows build tools globally: npm install --global --production windows-build-tools
Finally npm install bcrypt --save
After this everything worked ok.
I also encountered this error.
I reinstall node-gyp using this command npm install node-gyp -g
after that I reinstall bccrypt using npm install bcrypt
And finally works
When working on the node API project.
Solution
rm -rf node_modules/bcrypt
npm install node-gyp -g
npm install bcrypt#[VERSION] -g
it's working for me on window 10.
I am trying to install "truffle" with npm, but I am not familiar with NodeJS and cant figure out why npm wont install it. I try npm install -g truffle in Powershell with Admin rights and after a few lines of output I get this block of error messages:
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (F:\nodeJS\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "F:\\nodeJS\\node.exe" "F:\\nodeJS\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Max\AppData\Roaming\npm\node_modules\truffle\node_modules\ether-pudding\node_modules\ethereumjs-testrpc\node_modules\ethereumjs-wallet\node_modules\scrypt.js\node_modules\scrypt
gyp ERR! node -v v4.5.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok\
And then after many many yellow lines I finally get this:
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "F:\\nodeJS\\node.exe" "F:\\nodeJS\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "truffle"
npm ERR! node v4.5.0
npm ERR! npm v2.15.9
npm ERR! code ELIFECYCLE
npm ERR! scrypt#6.0.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the scrypt#6.0.3 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the scrypt 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 information on how to open an issue for this project with:
npm ERR! npm bugs scrypt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls scrypt
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! F:\eth_truffle\npm-debug.log
After that nothing else happens and after a while it just terminates. There are no files (other than a single log file) in the directory I am currently in and the keyword "truffle" can also not be found by cmd/powershell.
As I said I have never worked with NodeJS before and have no idea what all this means. What I can do to get truffle running?
Your install is failing at node-gyp rebuild. Solutions to this problem are listed on the node-gyp repo. The quickest is:
"Option 1: Install all the required tools and configurations using Microsoft's windows-build-tools using npm install --global --production windows-build-tools from an elevated PowerShell or CMD.exe (run as Administrator)." This will install Python and Visual Studio correctly.
Also, you are using Node 4.5. The recommended version is 5+, according to the Truffle Docs
I was also facing the same problem...
Solution:
Run as administrator
npm install --global windows-build-tools
npm install -g truffle
I am trying to install homebridge package on debian on my Dragonboard 410c using 'npm install -g homebridge'. However, I keep running into the following error pasted below. I have already installed nodejs-legacy.
Is there a solution to this problem, or is there an alternative way to download and install the package ánd its dependencies without npm?
npm WARN excluding symbolic link utils/ncov -> lib/ncov.js
\
curve25519#1.1.0 install /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/curve25519
node-gyp rebuild
(node) child_process: options.customFds option is deprecated. Use options.stdio instead.
make: Entering directory '/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/curve25519/build'
CXX(target) Release/obj.target/curve/node_curve.o
SOLINK_MODULE(target) Release/obj.target/curve.node
COPY Release/curve.node
make: Leaving directory '/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/curve25519/build'
npm WARN excluding symbolic link utils/ncov -> lib/ncov.js
bignum#0.11.0 install /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/srp/node_modules/bignum
node-gyp configure build
(node) child_process: options.customFds option is deprecated. Use options.stdio instead.
gyp: Undefined variable openssl_config_path in binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:344:16)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.4.0-linaro-lt-qcom
gyp ERR! command "/usr/bin/nodejs" "/usr/bin/node-gyp" "configure" "build"
gyp ERR! cwd /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/srp/node_modules/bignum
gyp ERR! node -v v4.2.2
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
mdns#2.2.11 install /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/mdns
node-gyp rebuild
path.js:424
var path = (i >= 0) ? arguments[i] : process.cwd();
^
Error: ENOENT: no such file or directory, uv_cwd
at Error (native)
at Object.posix.resolve (path.js:424:50)
at Function.Module._resolveLookupPaths (module.js:249:17)
at Function.Module._resolveFilename (module.js:327:31)
at Function.Module._load (module.js:287:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object. (/usr/share/node-gyp/bin/node-gyp.js:13:11)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
npm ERR! bignum#0.11.0 install: node-gyp configure build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bignum#0.11.0 install script.
npm ERR! This is most likely a problem with the bignum package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp configure build
npm ERR! You can get their info via:
npm ERR! npm owner ls bignum
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 4.4.0-linaro-lt-qcom
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "homebridge"
npm ERR! cwd /home/linaro
npm ERR! node -v v4.2.2
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
ed25519#0.0.3 install /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/ed25519
node-gyp rebuild
I'd recommend trying your commands from a different directory. I was trying to install a specific module in
/Users/my_username/.nvm/versions/node/v8.11.3/lib/node_modules/
and it was failing with a very similar error. I moved to
/Users/my_username/.nvm/versions/
(accidentally) ran npm install and it's working now.
I also discovered npm doctor in this process, which may help you get to the bottom of your problem.
This is my enviroment with the command ionic info
Your system information:
Cordova CLI: 5.3.3
Gulp version: CLI version 3.9.0
Gulp local: Local version 3.9.0
Ionic Version: 1.1.0
Ionic CLI Version: 1.6.5
Ionic App Lib Version: 0.3.9
OS: Windows 8
Node Version: v4.1.1
When I run the command npm install, I get the following error:
node-sass#2.1.1 install C:\Users\FIDEL-CASA\Desktop\prueba\dsfasdfa\fidel\node
modules\gulp-sass\nodemodules\node-sass
node scripts/install.js
Can not download file from https://raw.githubusercontent.com/sass/node-sass-binaries/v2.1.1/win32-x64-node-4.1/binding.node
node-sass#2.1.1 postinstall C:\Users\FIDEL-CASA\Desktop\prueba\dsfasdfa\fidel\
node_modules\gulp-sass\node_modules\node-sass
node scripts/build.js
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: 404 status code downloading 64-bit node.lib
gyp ERR! stack at Request. (C:\Users\FIDEL-CASA\Desktop\prueba\ds
fasdfa\fidel\node_modules\gulp-sass\node_modules\node-sass\node_modules\pangyp\l
ib\install.js:403:20)
gyp ERR! stack at emitOne (events.js:82:20)
gyp ERR! stack at Request.emit (events.js:169:7)
gyp ERR! stack at Request.onRequestResponse (C:\Users\FIDEL-CASA\Desktop\pru
eba\dsfasdfa\fidel\node_modules\gulp-sass\node_modules\node-sass\node_modules\pa
ngyp\node_modules\request\request.js:1255:10)
gyp ERR! stack at emitOne (events.js:77:13)
gyp ERR! stack at ClientRequest.emit (events.js:169:7)
gyp ERR! stack at HTTPParser.parserOnIncomingClient (httpclient.js:415:21)
gyp ERR! stack at HTTPParser.parserOnHeadersComplete (httpcommon.js:88:23)
gyp ERR! stack at Socket.socketOnData (httpclient.js:305:20)
gyp ERR! stack at emitOne (events.js:77:13)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\FIDEL-CASA\D
esktop\prueba\dsfasdfa\fidel\node_modules\gulp-sass\node_modules\node-sas
s\node_modules\pangyp\bin\node-gyp" "rebuild"
gyp ERR! cwd C:\Users\FIDEL-CASA\Desktop\prueba\dsfasdfa\fidel\node_modules\gulp
-sass\node_modules\node-sass
gyp ERR! node -v v4.1.1
gyp ERR! pangyp -v v2.3.2
gyp ERR! not ok
Build failed
npm ERR! Windows_NT 6.2.9200
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\
node_modules\npm\bin\npm-cli.js" "install"
npm ERR! node v4.1.1
npm ERR! npm v2.14.4
npm ERR! path C:\Users\FIDEL-CASA\AppData\Roaming\npm-cache\lodash.template\3.6.
2\package\package.json.85c499c6dffff9035680b8e91062bf92
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rename
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\FIDEL-CASA\AppD
ata\Roaming\npm-cache\lodash.template\3.6.2\package\package.json.85c499c6dffff90
35680b8e91062bf92' -> 'C:\Users\FIDEL-CASA\AppData\Roaming\npm-cache\lodash.temp
late\3.6.2\package\package.json'
npm ERR! at Error (native)
npm ERR! { [Error: EPERM: operation not permitted, rename 'C:\Users\FIDEL-CASA\
AppData\Roaming\npm-cache\lodash.template\3.6.2\package\package.json.85c499c6dff
ff9035680b8e91062bf92' -> 'C:\Users\FIDEL-CASA\AppData\Roaming\npm-cache\lodash.
template\3.6.2\package\package.json']
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path: 'C:\Users\FIDEL-CASA\AppData\Roaming\npm-cache\lodash.tem
plate\3.6.2\package\package.json.85c499c6dffff9035680b8e91062bf92',
npm ERR! dest: 'C:\Users\FIDEL-CASA\AppData\Roaming\npm-cache\lodash.tem
plate\3.6.2\package\package.json',
npm ERR! parent: 'gulp-util' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\FIDEL-CASA\Desktop\prueba\dsfasdfa\fidel\npm-debug.log
I think the problem is caused by the version of "gulp-sass": "^1.3.3" which uses the "node-sass" : "^2.0.1". Here https://goo.gl/jFeu7s said that this node-sass version does not work with node v4.1.1, it does not work even with the node v4.0.0.
Do you recommend in this case back to node v0.12.7 ?
Why Ionic not use a more recent gulp-sass version to resolve that issue?
I was having same problem with my node version 4.*, yes it is caused by
"gulp-sass": "^1.3.3"
I solved my issue with this. First remove gulp-sass dependency from the package.json, Then try
npm install --save gulp-sass#2
or
npm install --save-dev gulp-sass#2
I've just fixed problems with libsass or node-sass with this command:
$ sudo rm -rf node_modules/ && cat package.json | sed -i.bak 's/"gulp-sass": "^X.X.X"/"gulp-sass": "^2.0.4"/g' package.json && npm install && ionic lib update
Where X is the version of gulp-sass in your package.json
Explanation:
Remove the old files in node_modules. I'm not sure is necessary to use 'sudo' (in my case, yes).
$ sudo rm -rf node_modules/
Search and replace inside package.json updating gulp-sass version to ^2.0.4. It also creates a backup (package.json.bak),
$ cat package.json | sed -i.bak 's/"gulp-sass": "^X.X.X"/"gulp-sass": "^2.0.4"/g' package.json
Reinstall dependencies
$ npm install
Update the ionic lib in the project
ionic lib update
If you have any further problems be sure I try can help you...
Bye