Not able to install bcrypt - express

aakanksha#aakanksha:~/Documents/shoutbox/node_modules$ sudo npm install bcrypt
> bcrypt#0.8.1 install / /home/aakanksha/Documents/shoutbox/node_modules/bcrypt
> node-gyp rebuild
make: Entering directory ` /home/aakanksha/Documents/shoutbox/node_modules/bcrypt/build'
CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
make: g++: Command not found
make: *** [Release/obj.target/bcrypt_lib/src/blowfish.o] Error 127
make: Leaving directory `/home/aakanksha/Documents/shoutbox/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/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Linux 3.13.0-44-generic
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node- gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/aakanksha/Documents/shoutbox/node_modules/bcrypt
gyp ERR! node -v v0.10.36
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok
npm ERR! Linux 3.13.0-44-generic
npm ERR! argv "node" "/usr/bin/npm" "install" "bcrypt"
npm ERR! node v0.10.36
npm ERR! npm v2.6.0
npm ERR! code ELIFECYCLE
npm ERR! bcrypt#0.8.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt#0.8.1 install script 'node-gyp rebuild'.
npm ERR! 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-gyp rebuild
npm ERR! 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/aakanksha/Documents/shoutbox/node_modules/npm- debug.log
I am getting this error while installing bcrypt.I have tried following things:
npm install -g npm
sudo npm i -g node-gyp && node-gyp clean
But even after running above commands,if i agin install bcrypt it gives me error.

Related

There are too many problems with the installation "npm install nodegit"

PS P:\CSS-Strategy> git --version
git version 2.36.1.windows.1
PS P:\CSS-Strategy> npm --version
8.13.2
PS P:\CSS-Strategy> node --version
v16.17.0
PS P:\CSS-Strategy> npm install nodegit
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
npm WARN deprecated uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be
problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated node-pre-gyp#0.13.0: Please upgrade to #mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the #mapbox scoped package will recieve updates in the future
npm ERR! code 1
npm ERR! path P:\CSS-Strategy\node_modules\nodegit
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c C:\Users\junu\AppData\Local\Temp\install6629975969.cmd
npm ERR! [nodegit] Running pre-install script
npm ERR! [nodegit] Running install script
npm ERR! Failed to execute 'P:\Program Files\nodejs\node.exe C:\Users\junu\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=P:\CSS-Strategy\node_modules\nodegit\build\Release\nodegit.node --module_name=nodegit --module_path=P:\CSS-Strategy\node_modules\nodegit\build\Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1)
npm ERR! node-pre-gyp
npm ERR! info it worked if it ends with ok
npm ERR! node-pre-gyp info
npm ERR! using node-pre-gyp#0.13.0
npm ERR! node-pre-gyp info using node#16.17.0 | win32 | x64
npm ERR! node-pre-gyp WARN Using request for node-pre-gyp https download
npm ERR! node-pre-gyp info check checked for "P:\CSS-Strategy\node_modules\nodegit\build\Release\nodegit.node" (not found)
npm ERR! node-pre-gyp
npm ERR! http GET https://axonodegit.s3.amazonaws.com/nodegit/nodegit/nodegit-v0.27.0-node-v93-win32-x64.tar.gz
npm ERR! node-pre-gyp http
npm ERR! 404 https://axonodegit.s3.amazonaws.com/nodegit/nodegit/nodegit-v0.27.0-node-v93-win32-x64.tar.gz
npm ERR! node-pre-gyp WARN Tried to download(404): https://axonodegit.s3.amazonaws.com/nodegit/nodegit/nodegit-v0.27.0-node-v93-win32-x64.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not found for nodegit#0.27.0 and node#16.17.0 (node-v93 ABI, unknown) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp http 404 status code downloading tarball https://axonodegit.s3.amazonaws.com/nodegit/nodegit/nodegit-v0.27.0-node-v93-win32-x64.tar.gz
npm ERR! gyp
npm ERR!
npm ERR! info it worked if it ends with ok
npm ERR! gyp
npm ERR! info using node-gyp#9.0.0
npm ERR! gyp
npm ERR! info using node#16.17.0 | win32 | x64
npm ERR! gyp
npm ERR! info ok
npm ERR! gyp
npm ERR! info it worked if it ends with ok
npm ERR! gyp info
npm ERR! using node-gyp#9.0.0
npm ERR! gyp info using node#16.17.0 | win32 | x64
npm ERR! gyp info
npm ERR! find Python using Python version 3.10.7 found at "C:\Users\junu\AppData\Local\Programs\Python\Python310\python.exe"
npm ERR! gyp ERR!
npm ERR! find VS
npm ERR! gyp ERR! find VS msvs_version not set from command line or npm config
npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp ERR! find VS checking VS2019 (16.8.30711.63) found at:
npm ERR! gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"
npm ERR! gyp ERR! find VS - found "Visual Studio C++ core features"
npm ERR! gyp ERR! find VS - found VC++ toolset: v142
npm ERR! gyp ERR! find VS - missing any Windows SDK
npm ERR! gyp ERR! find VS
npm ERR! could not find a version of Visual Studio 2017 or newer to use
npm ERR! gyp ERR! find VS looking for Visual Studio 2015
npm ERR! gyp ERR! find VS - not found
npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp
npm ERR! ERR! find VS
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload.
npm ERR! gyp
npm ERR! ERR! find VS For more information consult the documentation at:
npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm ERR! gyp ERR! find VS
npm ERR! gyp
npm ERR! ERR! find VS
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use
npm ERR! gyp ERR! stack at VisualStudioFinder.fail (C:\Users\junu\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:122:47)
npm ERR! gyp ERR!
npm ERR! stack at C:\Users\junu\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:75:16
npm ERR! gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Users\junu\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:363:14)
npm ERR! gyp ERR! stack at C:\Users\junu\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:71:14
npm ERR! gyp ERR!
npm ERR! stack at C:\Users\junu\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:384:16
npm ERR! gyp ERR! stack at C:\Users\junu\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
npm ERR! gyp ERR! stack at C:\Users\junu\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
npm ERR! gyp ERR!
npm ERR! stack at ChildProcess.exithandler (node:child_process:408:5)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack at maybeClose (node:internal/child_process:1093:16)
npm ERR! gyp ERR! System Windows_NT 10.0.19043
npm ERR! gyp ERR! command "P:\Program Files\nodejs\node.exe" "C:\Users\junu\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "configure" "--fallback-to-build" "--module=P:\CSS-Strategy\node_modules\nodegit\build\Release\nodegit.node" "--module_name=nodegit" "--module_path=P:\CSS-Strategy\node_modules\nodegit\build\Release" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v93"
npm ERR! gyp ERR! cwd
npm ERR! P:\CSS-Strategy\node_modules\nodegit
npm ERR! gyp ERR! node -v v16.17.0
npm ERR! gyp ERR! node-gyp -v v9.0.0
npm ERR! gyp ERR! not ok
npm ERR! node-pre-gyp ERR!
npm ERR! build error
npm ERR! node-pre-gyp
npm ERR! ERR! stack Error: Failed to execute 'P:\Program Files\nodejs\node.exe C:\Users\junu\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=P:\CSS-Strategy\node_modules\nodegit\build\Release\nodegit.node --module_name=nodegit --module_path=P:\CSS-Strategy\node_modules\nodegit\build\Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1)
npm ERR! node-pre-gyp ERR! stack at ChildProcess. (P:\CSS-Strategy\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.emit (node:events:513:28)
npm ERR! node-pre-gyp ERR!
npm ERR! stack at maybeClose (node:internal/child_process:1093:16)
npm ERR! node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
npm ERR! node-pre-gyp ERR!
npm ERR! System Windows_NT 10.0.19043
npm ERR! node-pre-gyp ERR! command "P:\Program Files\nodejs\node.exe" "P:\CSS-Strategy\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd P:\CSS-Strategy\node_modules\nodegit
npm ERR! node-pre-gyp ERR! node -v v16.17.0
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v0.13.0
npm ERR! node-pre-gyp ERR! not ok
npm ERR! [nodegit] ERROR - Could not finish install
npm ERR! [nodegit] ERROR - finished with error code: 1
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\junu\AppData\Local\npm-cache_logs\2022-09-12T15_44_33_340Z-debug-0.log

I am unable to install truffle. Keeps loading up a list of errors

I tried installing truffle through the VSCode terminal.
After pressing npm install -g truffle it loads for a while then displays the following erros
npm ERR! code 1
npm ERR! path C:\Users\User\AppData\Roaming\npm\node_modules\truffle\node_modules\ganache\node_modules\#trufflesuite\bigint-buffer
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp#8.4.1
npm ERR! gyp info using node#16.14.2 | win32 | x64
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! find Python Python is not set from command line or npm configuration
npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON
npm ERR! gyp ERR! find Python checking if "python3" can be used
npm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if "python" can be used
npm ERR! gyp ERR! find Python - "python" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if Python is C:\Users\User\AppData\Local\Programs\Python\Python39\python.exe
...
xe" could not be run
npm ERR! gyp ERR! find Python checking if the py launcher can be used to find Python 3
npm ERR! gyp ERR! find Python - "py.exe" is not in PATH or produced an error
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python You need to install the latest version of Python.
npm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
npm ERR! gyp ERR! find Python you can try one of the following options:
npm ERR! gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe"
npm ERR! gyp ERR! find Python (accepted by both node-gyp and npm)
npm ERR! gyp ERR! find Python - Set the environment variable PYTHON
npm ERR! gyp ERR! find Python - Set the npm configuration variable python:
npm ERR! gyp ERR! find Python For more information consult the documentation at:
npm ERR! gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Python installation to use
npm ERR! gyp ERR! stack at PythonFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:330:47)
npm ERR! gyp ERR! stack at PythonFinder.runChecks (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:159:21)
npm ERR! gyp ERR! stack at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:228:18)
npm ERR! gyp ERR! stack at PythonFinder.execFileCallback (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:294:16)npm ERR! gyp ERR! stack at exithandler (node:child_process:406:5)
npm ERR! gyp ERR! stack at ChildProcess.errorhandler (node:child_process:418:5)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
npm ERR! gyp ERR! stack at onErrorNT (node:internal/child_process:478:16)
npm ERR! gyp ERR! stack at processTicksAndRejections (node:internal/process/task_queues:83:21)
npm ERR! gyp ERR! System Windows_NT 10.0.19042
npm ERR! 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"
npm ERR! gyp ERR! cwd C:\Users\User\AppData\Roaming\npm\node_modules\truffle\node_modules\ganache\node_modules\#trufflesuite\bigint-buffer
npm ERR! gyp ERR! node -v v16.14.2
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\User\AppData\Local\npm-cache\_logs\2022-04-11T15_21_46_199Z-debug-0.log
How can I fix this, please? I have installed the package 4 times and the error keep showing up.

Can't install appmetrics with npm

I'm trying to install access-watch with no success.
After cloning the repo I call npm i and I get the following error. It appears to occur when the installation process tries to install appmetrics. So I tried npm i appmetrics and got the exact same error, hence the title of this question.
Here's the tail of the trace,
$ cd access-watch
$ npm i
/home/gandalf/.cache/node-gyp/14.18.0/include/node/v8.h:6482:46: note: candidate expects 1 argument, 0 provided
Release/obj.target/appmetrics/geni/appmetrics.cpp: At global scope:
Release/obj.target/appmetrics/geni/appmetrics.cpp:641:13: warning: ‘bool isAppMetricsFile(std::__cxx11::string, std::__cxx11::string)’ defined but not used [-Wunused-function]
static bool isAppMetricsFile(std::string expected, std::string potentialMatch) {
^~~~~~~~~~~~~~~~
Makefile:282: recipe for target 'Release/obj.target/appmetrics/geni/appmetrics.o' failed
make: *** [Release/obj.target/appmetrics/geni/appmetrics.o] Error 1
make: Leaving directory '/home/gandalf/access-watch/node_modules/appmetrics/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/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:400:28)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:282:12)
gyp ERR! System Linux 4.15.0-66-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/gandalf/access-watch/node_modules/appmetrics
gyp ERR! node -v v14.18.0
gyp ERR! node-gyp -v v8.2.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! appmetrics#4.0.1 install: `node extract_all_binaries.js || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the appmetrics#4.0.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/gandalf/.npm/_logs/2021-10-11T13_41_15_454Z-debug.log
And here's the full thing: https://pastebin.com/cYsHa1EP
I know node-gyp must be installed and it is:
$ node-gyp --version
v8.2.0
I found an issue in appmetric's github and ran with CC=gcc-9 but to no success.
Thanks!

Error while installing npm-java on Ubuntu 18.0.4

I have latest npm 6.7.0 version. I tried to install npm-java module but it gives following error. Here I can see permission issue but I am running it with root permission using sudo. What is the reason for this issue and how to get it fixed?
malintha#malintha-laptop:~$ sudo npm -g install java
> java#0.11.0 install /usr/local/lib/node_modules/java
> node-gyp rebuild
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/java/build'
gyp ERR! System Linux 4.15.0-44-generic
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 /usr/local/lib/node_modules/java
gyp ERR! node -v v8.9.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! java#0.11.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the java#0.11.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! /home/malintha/.npm/_logs/2019-02-04T11_42_36_223Z-debug.log
Solved it removing sudo from the installation command. Just run npm installjava

npm install for Hyperledger Tutorial Fails

I am currently working on a fresh minimal install of Ubuntu 16.0.4 using Hyperledger Fabric. I have pulled down a fresh install of the fabric samples from the Hyperledger documentation site. I have downloaded the following software:
node version 6.9.5
npm version 3.10.10
docker version 17.03.2-ce
golang version 1.7.6 (documentation now calls for newer version, but I think this is unrelated)
I can navigate to the fabcar directory which contains the default npm package.json. I first run ./startFabric as indicated in the instructions. I then run npm install, per the instructions. I then get the error:
u#ubmin2:~/fabric-samples/fabcar$ npm install
npm WARN deprecated crypto#0.0.3: This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in.
> pkcs11js#1.0.9 install /home/u/fabric-samples/fabcar/node_modules/pkcs11js
> npm run build
> pkcs11js#1.0.9 build /home/u/fabric-samples/fabcar/node_modules/pkcs11js
> node-gyp configure build
gyp ERR! build error
gyp ERR! stack Error: not found: make
gyp ERR! stack at getNotFoundError (/usr/local/node/lib/node_modules/npm/node_modules/which/which.js:14:12)
gyp ERR! stack at F (/usr/local/node/lib/node_modules/npm/node_modules/which/which.js:69:19)
gyp ERR! stack at E (/usr/local/node/lib/node_modules/npm/node_modules/which/which.js:81:29)
gyp ERR! stack at /usr/local/node/lib/node_modules/npm/node_modules/which/which.js:90:16
gyp ERR! stack at /usr/local/node/lib/node_modules/npm/node_modules/which/node_modules/isexe/index.js:44:5
gyp ERR! stack at /usr/local/node/lib/node_modules/npm/node_modules/which/node_modules/isexe/access.js:8:5
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:123:15)
gyp ERR! System Linux 4.4.0-96-generic
gyp ERR! command "/usr/local/node/bin/node" "/usr/local/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"
gyp ERR! cwd /home/u/fabric-samples/fabcar/node_modules/pkcs11js
gyp ERR! node -v v6.9.5
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm ERR! Linux 4.4.0-96-generic
npm ERR! argv "/usr/local/node/bin/node" "/usr/local/node/bin/npm" "run" "build"
npm ERR! node v6.9.5
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! pkcs11js#1.0.9 build: `node-gyp configure build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pkcs11js#1.0.9 build script 'node-gyp configure 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 pkcs11js 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 information on how to open an issue for this project with:
npm ERR! npm bugs pkcs11js
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls pkcs11js
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
...
Based on that, it appears that there is a missing pkcs11js module that needs to be included. When I add that module to the package.json file, remove the node_modules file and rerun the "npm install," the error shifts to:
u#ubmin2:~/fabric-samples/fabcar$ npm install
npm WARN deprecated crypto#0.0.3: This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in.
> pkcs11js#1.0.9 install /home/u/fabric-samples/fabcar/node_modules/pkcs11js
> npm run build
> pkcs11js#1.0.9 build /home/u/fabric-samples/fabcar/node_modules/pkcs11js
> node-gyp configure build
gyp ERR! build error
gyp ERR! stack Error: not found: make
gyp ERR! stack at getNotFoundError (/usr/local/node/lib/node_modules/npm/node_modules/which/which.js:14:12)
gyp ERR! stack at F (/usr/local/node/lib/node_modules/npm/node_modules/which/which.js:69:19)
gyp ERR! stack at E (/usr/local/node/lib/node_modules/npm/node_modules/which/which.js:81:29)
gyp ERR! stack at /usr/local/node/lib/node_modules/npm/node_modules/which/which.js:90:16
gyp ERR! stack at /usr/local/node/lib/node_modules/npm/node_modules/which/node_modules/isexe/index.js:44:5
gyp ERR! stack at /usr/local/node/lib/node_modules/npm/node_modules/which/node_modules/isexe/access.js:8:5
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:123:15)
gyp ERR! System Linux 4.4.0-96-generic
gyp ERR! command "/usr/local/node/bin/node" "/usr/local/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"
gyp ERR! cwd /home/u/fabric-samples/fabcar/node_modules/pkcs11js
gyp ERR! node -v v6.9.5
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm ERR! Linux 4.4.0-96-generic
npm ERR! argv "/usr/local/node/bin/node" "/usr/local/node/bin/npm" "run" "build"
npm ERR! node v6.9.5
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! pkcs11js#1.0.9 build: `node-gyp configure build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pkcs11js#1.0.9 build script 'node-gyp configure 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 pkcs11js 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 information on how to open an issue for this project with:
npm ERR! npm bugs pkcs11js
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls pkcs11js
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! Please include the following file with any support request:
npm ERR! /home/u/fabric-samples/fabcar/node_modules/pkcs11js/npm-debug.log
fabcar#1.0.0 /home/u/fabric-samples/fabcar
...
Does anyone understand why npm install is failing to run as expected?
------UPDATE------
in response to christo4ferris, sorry, I should have shown that as well. I've tried many things including installing and removing make. when I install make, I still get an error:
npm WARN fabcar#1.0.0 No repository field.
npm ERR! Linux 4.4.0-96-generic
npm ERR! argv "/usr/local/node/bin/node" "/usr/local/node/bin/npm" "install"
npm ERR! node v6.9.5
npm ERR! npm v3.10.10
npm ERR! path /home/u/fabric-samples/fabcar/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/home/u/fabric-samples/fabcar/node_modules'
npm ERR! at Error (native)
npm ERR! { Error: EACCES: permission denied, access '/home/u/fabric-samples/fabcar/node_modules'
npm ERR! at Error (native)
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/home/u/fabric-samples/fabcar/node_modules' }
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/u/fabric-samples/fabcar/npm-debug.log
And then, when I run as sudo us to run as root, I get this error message:
root#ubmin2:/home/u/fabric-samples/fabcar# npm install
npm WARN deprecated crypto#0.0.3: This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in.
> pkcs11js#1.0.9 install /home/u/fabric-samples/fabcar/node_modules/pkcs11js
> npm run build
> pkcs11js#1.0.9 build /home/u/fabric-samples/fabcar/node_modules/pkcs11js
> node-gyp configure build
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/u/fabric-samples/fabcar/node_modules/pkcs11js/.node-gyp"
make: Entering directory '/home/u/fabric-samples/fabcar/node_modules/pkcs11js/build'
CXX(target) Release/obj.target/pkcs11/src/main.o
make: g++: Command not found
pkcs11.target.mk:107: recipe for target 'Release/obj.target/pkcs11/src/main.o' failed
make: *** [Release/obj.target/pkcs11/src/main.o] Error 127
make: Leaving directory '/home/u/fabric-samples/fabcar/node_modules/pkcs11js/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/node/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.0-96-generic
gyp ERR! command "/usr/local/node/bin/node" "/usr/local/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"
gyp ERR! cwd /home/u/fabric-samples/fabcar/node_modules/pkcs11js
gyp ERR! node -v v6.9.5
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm ERR! Linux 4.4.0-96-generic
npm ERR! argv "/usr/local/node/bin/node" "/usr/local/node/bin/npm" "run" "build"
npm ERR! node v6.9.5
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! pkcs11js#1.0.9 build: `node-gyp configure build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pkcs11js#1.0.9 build script 'node-gyp configure 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 pkcs11js 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 information on how to open an issue for this project with:
npm ERR! npm bugs pkcs11js
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls pkcs11js
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! Please include the following file with any support request:
npm ERR! /home/u/fabric-samples/fabcar/node_modules/pkcs11js/npm-debug.log
fabcar#1.0.0 /home/u/fabric-samples/fabcar
Thank you.
The issue was that I was missing a necessary c++ compiler. It seems it was not included in the Ubuntu minimal installation, which makes sense, but the errors seemed very opaque. Running sudo apt install build-essential g++ seems to have solved the problem.
I'm not sure if it was necessary, but I also needed to add alias sudo='sudo env PATH=$PATH' to my .bashrc file so I could run npm with sudo. That solution came from this link.