I get an issue when installing node-sass on my server (Ubuntu 16.04). On my local server I haven't theses errors...
NodeJS version : v10.2.1
Npm version : 5.6.0
Node sass version : ^4.9.0
Error message :
****#web-test:/var/www/****$ sudo npm i node-sass
> node-sass#4.9.0 install /var/www/****/node_modules/node-sass
> node scripts/install.js
Unable to save binary /var/www/****/node_modules/node-sass/vendor/linux-x64-64 : { Error: EACCES: permission denied, mkdir '/var/www/****/node_modules/node-sass/vendor'
at Object.fs.mkdirSync (fs.js:872:3)
at sync (/var/www/****/node_modules/mkdirp/index.js:71:13)
at Function.sync (/var/www/****/node_modules/mkdirp/index.js:77:24)
at checkAndDownloadBinary (/var/www/****/node_modules/node-sass/scripts/install.js:114:11)
at Object.<anonymous> (/var/www/****/node_modules/node-sass/scripts/install.js:157:1)
at Module._compile (internal/modules/cjs/loader.js:702:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
at Module.load (internal/modules/cjs/loader.js:612:32)
at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
at Function.Module._load (internal/modules/cjs/loader.js:543:3)
errno: -13,
syscall: 'mkdir',
code: 'EACCES',
path: '/var/www/****/node_modules/node-sass/vendor' }
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/var/www/****/node_modules/node-sass/build'
gyp ERR! System Linux 4.4.0-116-generic
gyp ERR! command "/usr/local/bin/node" "/var/www/****/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /var/www/****/node_modules/node-sass
gyp ERR! node -v v10.2.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm WARN ****#1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass#4.9.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#4.9.0 postinstall 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/****/.npm/_logs/2018-06-04T14_54_18_635Z-debug.log
Permissions on the folder : drwxr-xr-x 11 root root 4096 june 4 17:25 ****
Error after updating rights :
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:258:23)
gyp ERR! stackbcrypt_lib.target.mk:97: recipe for target 'Release/obj.target/bcrypt_lib/src/bcrypt_node.o' failed
make: *** [Release/obj.target/bcrypt_lib/src/bcrypt_node.o] Error 1
make: Leaving directory '/var/www/****/node_modules/bcrypt/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:258:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Linux 4.4.0-116-generic
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=/var/www/****/node_modules/bcrypt/lib/binding/bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=/var/www/****/node_modules/bcrypt/lib/binding"
gyp ERR! cwd /var/www/****/node_modules/bcrypt
gyp ERR! node -v v10.2.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Linux 4.4.0-116-generic
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=/var/www/****/node_modules/bcrypt/lib/binding/bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=/var/www/****/node_modules/bcrypt/lib/binding"
gyp ERR! cwd /var/www/****/node_modules/bcrypt
gyp ERR! node -v v10.2.1
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 build --fallback-to-build --module=/var/www/****/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/var/www/****/node_modules/bcrypt/lib/binding' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/var/www/****/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:182:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:961:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:5)
node-pre-gyp ERR! System Linux 4.4.0-116-generic
node-pre-gyp ERR! command "/usr/local/bin/node" "/var/www/****/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd /var/www/****/node_modules/bcrypt
node-pre-gyp ERR! node -v v10.2.1
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 build --fallback-to-build --module=/var/www/****/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/var/www/****/node_modules/bcrypt/lib/binding' (1)
npm WARN ****#1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bcrypt#1.0.3 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt#1.0.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Right solution (after many searches) :
sudo rm -rf ~/.node-gyp
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
sudo npm i --unsafe-perm
It seems that the root user is the only one who has access to the /www/var folder. It would be better to create a dedicated user for that.
First of all, check with which user you're currently logged in with the following command:
$ whoami
And update the permissions of your destination folder for that user:
sudo chown -R $USER /var/www/[YOUR FOLDER]
And finally run npm install again.
Related
I'm new in node and i'd like to run this project :
https://github.com/srtucker22/chatty
When i clone and run the command npm install i'm getting :
~~~~~~~~~~~~~~~~~ ^
/Users/allstar/Library/Caches/node-gyp/14.13.0/include/node/v8.h:2810:3: note: 'ToString' declared here
V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
^
/Users/allstar/Library/Caches/node-gyp/14.13.0/include/node/v8config.h:431:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
make: *** [Release/obj.target/bcrypt_lib/src/bcrypt_node.o] Error 1
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:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:314:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Darwin 19.6.0
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=/Users/allstar/dev/github/chatty/node_modules/bcrypt/lib/binding/bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=/Users/allstar/dev/github/chatty/node_modules/bcrypt/lib/binding" "--napi_version=7" "--node_abi_napi=napi"
gyp ERR! cwd /Users/allstar/dev/github/chatty/node_modules/bcrypt
gyp ERR! node -v v14.13.0
gyp ERR! node-gyp -v v5.1.0
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=/Users/allstar/dev/github/chatty/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/Users/allstar/dev/github/chatty/node_modules/bcrypt/lib/binding --napi_version=7 --node_abi_napi=napi' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/Users/allstar/dev/github/chatty/node_modules/bcrypt/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:314:20)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1047:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
node-pre-gyp ERR! System Darwin 19.6.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/Users/allstar/dev/github/chatty/node_modules/bcrypt/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/allstar/dev/github/chatty/node_modules/bcrypt
node-pre-gyp ERR! node -v v14.13.0
node-pre-gyp ERR! node-pre-gyp -v v0.10.2
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=/Users/allstar/dev/github/chatty/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/Users/allstar/dev/github/chatty/node_modules/bcrypt/lib/binding --napi_version=7 --node_abi_napi=napi' (1)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 (node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 install: `node install`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bcrypt#3.0.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt#3.0.0 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! /Users/allstar/.npm/_logs/2020-10-06T09_37_52_418Z-debug.log
Can any help on what is wrong ?
mu current versions are :
npm : 6.14.8
node : v14.13.0
Thanks
Have you tried running with a stable version of node?
like 12.18.3
It's a error related to node-pre-gyp.
Try to execute npm install with flag --build-from-resource:
npm install --build-from-resource
https://github.com/nodejs/node-gyp/issues/1599
Try the below steps:
Delete node_modules folder, if present.
npm cache clean --force
npm install
I could not install library of tensorflow.js module in my project, in local machine. It's portraying the problem as follows:
Building TensorFlow Node.js bindings
C:\mlwithjs\tensorflowjs\node_modules\#tensorflow\tfjs-node\scripts\install.js:176
throw new Error('node-gyp rebuild failed with: ' + err);
^
Error: node-gyp rebuild failed with: Error: Command failed: node-gyp rebuild
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\mlwithjs\tensorflowjs\node_modules\#tensorflow\tfjs-node
gyp ERR! node -v v10.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
at cp.exec (C:\mlwithjs\tensorflowjs\node_modules\#tensorflow\tfjs-node\scripts\install.js:176:13)
at ChildProcess.exithandler (child_process.js:301:5)
at ChildProcess.emit (events.js:182:13)
at maybeClose (internal/child_process.js:962:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
npm WARN rollback Rolling back #types/seedrandom#2.4.27 failed (this is probably harmless): EPERM: operation not permitted, rmdir 'C:\mlwithjs\tensorflowjs\node_modules\#types'
npm WARN rollback Rolling back #types/webgl2#0.0.4 failed (this is probably harmless): EPERM: operation not permitted, rmdir 'C:\mlwithjs\tensorflowjs\node_modules\#types'npm WARN tensorflowjs#1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! #tensorflow/tfjs-node#0.2.1 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the #tensorflow/tfjs-node#0.2.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! C:\Users\Saqib\AppData\Roaming\npm-cache\_logs\2019-01-03T15_18_04_741Z-debug.log
I have tried a command npm install -g build tools. Although it's installing other modules.
I am using npm install #tensorflow/tfjs-node command to install it, but it didn't help. I googled for it, but haven't found anything.
This is the error I get when running npm install --save mocha ganache-cli web3#1.0.0-beta.26 :
rohitgoud$ npm install --save mocha ganache-cli web3#1.0.0-beta.26
> scrypt#6.0.3 preinstall /Users/rohitgoud/node_modules/scrypt
> node node-scrypt-preinstall.js
Error: Error: Command failed: ./configure
configure: error: in `/Users/rohitgoud/node_modules/scrypt/scrypt/scrypt-1.2.0':
configure: error: C compiler cannot create executables
See `config.log' for more details
> scrypt#6.0.3 install /Users/rohitgoud/node_modules/scrypt
> node-gyp rebuild
gyp ERR! configure error
gyp ERR! stack Error: Python executable "/anaconda3/bin/python" is v3.6.4, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack at PythonFinder.failPythonVersion (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:492:19)
gyp ERR! stack at PythonFinder.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:474:14)
gyp ERR! stack at ChildProcess.exithandler (child_process.js:267:7)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at maybeClose (internal/child_process.js:925:16)
gyp ERR! stack at Socket.stream.socket.on (internal/child_process.js:346:11)
gyp ERR! stack at emitOne (events.js:116:13)
gyp ERR! stack at Socket.emit (events.js:211:7)
gyp ERR! stack at Pipe._handle.close [as _onclose] (net.js:567:12)
gyp ERR! System Darwin 16.7.0
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 /Users/rohitgoud/node_modules/scrypt
gyp ERR! node -v v8.11.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open '/Users/rohitgoud/package.json'
npm WARN webpack-cli#2.0.15 requires a peer of webpack#^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN rohitgoud No description
npm WARN rohitgoud No repository field.
npm WARN rohitgoud No README data
npm WARN rohitgoud No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
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.
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! /Users/rohitgoud/.npm/_logs/2018-04-26T01_45_43_548Z-debug.log
you need install python2.7(recommend)
I am tring to execute fabcar example from Hyperledger-fabric where I have created few cars. When I try to execute
node query.js
at ../fabric-samples/fabcar I am getting an error
fabric-client not found
If I execute
npm install
I have node 6.9.0 and npm 3.10.0
I am getting error like this
> grpc#1.2.4 install /home/.../fabric-samples/fabcar/node_modules/grpc
> node-pre-gyp install --fallback-to-build
node-pre-gyp ERR! Tried to download(403): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.2.4/node-v57-linux-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for grpc#1.2.4 and node#8.0.0 (node-v57 ABI) (falling back to source compile with node-gyp)
gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/8.0.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/home/.../fabric-samples/fabcar/node_modules/grpc/.node-gyp"
make: Entering directory '/home/.../fabric-samples/fabcar/node_modules/grpc/build'
make: *** No rule to make target '../.node-gyp/8.0.0/include/node/common.gypi', needed by 'Makefile'. Stop.
make: Leaving directory '/home/.../fabric-samples/fabcar/node_modules/grpc/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:125:13)
gyp ERR! stack at ChildProcess.emit (events.js:213:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:197:12)
gyp ERR! System Linux 4.4.0-42-generic
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/.../fabric-samples/fabcar/node_modules/grpc/src/node/extension_binary/grpc_node.node" "--module_name=grpc_node" "--module_path=/home/.../fabric-samples/fabcar/node_modules/grpc/src /node/extension_binary"
gyp ERR! cwd /home/.../fabric-samples/fabcar/node_modules/grpc
gyp ERR! node -v v8.0.0
gyp ERR! node-gyp -v v3.3.1
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/.../fabric-samples/fabcar/node_modules/grpc/src/node/extension_binary/grpc_node.node
--module_name=grpc_node --module_path=/home/.../fabric-samples/fabcar/node_modules/grpc/src/node/extension_binary' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/home/.../fabric-samples/fabcar/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:125:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:213:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:887:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:208:5)
node-pre-gyp ERR! System Linux 4.4.0-42-generic
node-pre-gyp ERR! command "/usr/local/bin/node" "/home/.../fabric-samples/fabcar/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/.../fabric-samples/fabcar/node_modules/grpc
node-pre-gyp ERR! node -v v8.0.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.34
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/.../fabric-samples/fabcar/node_modules/grpc/src/node/extension_binary/grpc_node.node --module_name=grpc_node --module_path=/home/.../fabric-samples/fabcar/node_modules/grpc/src /node/extension_binary' (1)
fabcar#1.0.0 /home/.../fabric-samples/fabcar`-- (empty)
npm WARN fabcar#1.0.0 No repository field.
npm ERR! Linux 4.4.0-42-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v8.0.0
npm ERR! npm v3.10.3
npm ERR! code ELIFECYCLE
npm ERR! grpc#1.2.4 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the grpc#1.2.4 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 grpc 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 grpc
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls grpc
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/.../fabric-samples/fabcar/npm-debug.log
npm ERR! code 1
can anyone help me to execute the code
It was solved after deleting directory node_module and then doing
npm install
I'm running raspbian on my raspberry pi 3. I'm trying to install the serialport module and many errors show up.
pi#raspberrypi:~/pmsensor $ sudo npm install --save serialport --fix-missing
This is what i get:
serialport#4.0.7 install /home/pi/pmsensor/node_modules/serialport
node-pre-gyp install --fallback-to-build
node-pre-gyp ERR! Tried to download(404): https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/4.0.7/serialport-v4.0.7-node-v48-linux-arm.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for serialport#4.0.7 and node#6.9.5 (node-v48 ABI) (falling back to source compile with node-gyp)
gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/6.9.5"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/home/pi/pmsensor/node_modules/serialport/.node-gyp"
make: Entering directory '/home/pi/pmsensor/node_modules/serialport/build'
make: *** No rule to make target '../.node-gyp/6.9.5/include/node/common.gypi', needed by 'Makefile'. Stop.
make: Leaving directory '/home/pi/pmsensor/node_modules/serialport/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/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 4.4.48-v7+
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/pi/pmsensor/node_modules/serialport/build/Release/serialport.node" "--module_name=serialport" "--module_path=/home/pi/pmsensor/node_modules/serialport/build/Release"
gyp ERR! cwd /home/pi/pmsensor/node_modules/serialport
gyp ERR! node -v v6.9.5
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/nodejs /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/pi/pmsensor/node_modules/serialport/build/Release/serialport.node --module_name=serialport --module_path=/home/pi/pmsensor/node_modules/serialport/build/Release' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/home/pi/pmsensor/node_modules/serialport/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 Linux 4.4.48-v7+
node-pre-gyp ERR! command "/usr/bin/nodejs" "/home/pi/pmsensor/node_modules/serialport/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/pi/pmsensor/node_modules/serialport
node-pre-gyp ERR! node -v v6.9.5
node-pre-gyp ERR! node-pre-gyp -v v0.6.32
node-pre-gyp ERR! not ok
Failed to execute '/usr/bin/nodejs /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/pi/pmsensor/node_modules/serialport/build/Release/serialport.node --module_name=serialport --module_path=/home/pi/pmsensor/node_modules/serialport/build/Release' (1)
npm WARN pmsensor#1.0.0 No repository field.
npm ERR! Linux 4.4.48-v7+
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--save" "serialport" "--fix-missing"
npm ERR! node v6.9.5
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! serialport#4.0.7 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the serialport#4.0.7 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 serialport 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 serialport
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls serialport
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/pi/pmsensor/npm-debug.log
You correctly figured out how to solve this. With the raspberry pi people usually run as root (as you are) and if you want to install a binary package with root (maybe any package), you need to use the --unsafe-perm flag with npm. The node serialport docs have more information.
https://github.com/EmergingTechnologyAdvisors/node-serialport#sudo--root