Cannot install xml2json module using npm in Windows 10 - npm

I am trying to install xml2json using npm , but the console returns the following error
I run npm i xml2json
Then , the console returns this error
C:\Users\VDSCH\Proyectos\Tossa\problemApp\node_modules\node-expat>if not defined npm_config_node_gyp (node "C:\Users\VDSCH\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Users\VDSCH\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "C:\Users\VDSCH\AppData\Local\Programs\Python\Python37-32"", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (C:\Users\VDSCH\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:484:19)
gyp ERR! stack at PythonFinder.<anonymous> (C:\Users\VDSCH\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:509:16)
gyp ERR! stack at C:\Users\VDSCH\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\polyfills.js:282:31
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:154:21)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\VDSCH\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\VDSCH\Proyectos\Tossa\problemApp\node_modules\node-expat
gyp ERR! node -v v10.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN problemapp#1.0.0 No description
npm WARN problemapp#1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-expat#2.3.18 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-expat#2.3.18 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\VDSCH\AppData\Roaming\npm-cache\_logs\2019-06-26T16_59_24_765Z-debug.log
In the end i have tried reinstalling node-gyp and node expat but those dont seem to work. Is there something wrong with the package or am i missing something from my own system variables?

The error itself says something about not finding the python executable, and asking you to set the PYTHON environment variable to locate it.
So, the first question is, do you have python installed? If not, you should install it.
Then, before you run the process again, set the PYTHON environment variable to locate it.

Related

How to remove the following npm install error?

Hi I am getting these errors while doing npm install. I have other projects in vuejs also. But those are running properly. I don't know why I am getting error in this vuejs project. I tried removing cache npm cache clean --force. I deleted the package-lock.json file and ran npm install. But still I am getting error. Can anyone tell me what to do?
Error:
> yorkie#2.0.0 install E:\BOP\pikflick change logo\pikflick-admin3\pikflick-admin\node_modules\yorkie
> node bin/install.js
setting up Git hooks
done
> fibers#4.0.3 install E:\BOP\pikflick change logo\pikflick-admin3\pikflick-admin\node_modules\fibers
> node build.js || nodejs build.js
E:\BOP\pikflick change logo\pikflick-admin3\pikflick-admin\node_modules\fibers>if not defined npm_config_node_gyp (node "D:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild --release ) else (node "D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild --release )
gyp ERR! find Python
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - "python" is not in PATH or produced an error
gyp ERR! find Python checking if "python2" can be used
gyp ERR! find Python - "python2" is not in PATH or produced an error
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - "python3" is not in PATH or produced an error
gyp ERR! find Python checking if the py launcher can be used to find Python 2
gyp ERR! find Python - "py.exe" is not in PATH or produced an error
gyp ERR! find Python checking if Python is C:\Python27\python.exe
gyp ERR! find Python - "C:\Python27\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Python37\python.exe
gyp ERR! find Python - "C:\Python37\python.exe" could not be run
gyp ERR! find Python
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
gyp ERR! find Python you can try one of the following options:
gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe"
gyp ERR! find Python (accepted by both node-gyp and npm)
gyp ERR! find Python - Set the environment variable PYTHON
gyp ERR! find Python - Set the npm configuration variable python:
gyp ERR! find Python npm config set python "C:\Path\To\python.exe"
gyp ERR! find Python For more information consult the documentation at:
gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
gyp ERR! find Python **********************************************************
gyp ERR! find Python
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Python installation to use
gyp ERR! stack at PythonFinder.fail (D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:307:47)
gyp ERR! stack at PythonFinder.runChecks (D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:136:21)
gyp ERR! stack at PythonFinder.<anonymous> (D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:225:16)
gyp ERR! stack at PythonFinder.execFileCallback (D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:271:16)
gyp ERR! stack at exithandler (child_process.js:315:5)
gyp ERR! stack at ChildProcess.errorhandler (child_process.js:327:5)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! stack at onErrorNT (internal/child_process.js:465:16)
gyp ERR! stack at processTicksAndRejections (internal/process/task_queues.js:80:21)
gyp ERR! System Windows_NT 10.0.18363
gyp ERR! command "D:\\Program Files\\nodejs\\node.exe" "D:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--release"
gyp ERR! cwd E:\BOP\pikflick change logo\pikflick-admin3\pikflick-admin\node_modules\fibers
gyp ERR! node -v v14.15.2
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
node-gyp exited with code: 1
Please make sure you are using a supported platform and node version. If you
would like to compile fibers on this machine please make sure you have setup your
build environment--
Windows + OS X instructions here: https://github.com/nodejs/node-gyp
Ubuntu users please run: `sudo apt-get install g++ build-essential`
RHEL users please run: `yum install gcc-c++` and `yum groupinstall 'Development Tools'`
Alpine users please run: `sudo apk add python make g++`
'nodejs' is not recognized as an internal or external command,
operable program or batch file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.13 (node_modules\webpack-dev-server\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.13 (node_modules\watchpack-chokidar2\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#2.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! fibers#4.0.3 install: `node build.js || nodejs build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the fibers#4.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! C:\Users\boidurja\AppData\Roaming\npm-cache\_logs\2021-01-01T14_13_13_850Z-debug.log

Gatsby failing to install with Starter. Build error

Hi I would like to use a gatsby starter for a blog site. However when I use the command gatbsy new [name-of-project] [url-of-starter]
It shows these errors.
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
make: *** [Release/obj.target/sharp/src/common.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:196:23)
gyp ERR! stack at ChildProcess.emit (events.js:203:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 18.6.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/david/Desktop/blog/node_modules/sharp
gyp ERR! node -v v12.8.1
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.7 (node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.7 install: `node install`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp#0.21.3 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sharp#0.21.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:
ERROR
Command failed with exit code 1 (EPERM): npm install
Error: Command failed with exit code 1 (EPERM): npm install
- error.js:58 makeError
[lib]/[gatsby-cli]/[execa]/lib/error.js:58:11
- index.js:112 handlePromise
[lib]/[gatsby-cli]/[execa]/index.js:112:26
- task_queues.js:85 processTicksAndRejections
internal/process/task_queues.js:85:5
I have tried uninstalling gatsby cli, yarn and npm to no prevail.
Thanks for any advice.
And the default starter works fine its when I use a starter thats the issue.

I could not successfully use install npm packages

I'm trying to download some source code and build a software. the README file said it need to use npm tools. like first use npm install, then npm run build, then npm run dev. However, I got stuck when I'm trying to use npm install. I could not successfully install npm packages.
Below are some error messages:
C:\Users\michael liu\Desktop\IBSMK\ibsmk\node_modules\usb-detection>if not defined npm_config_node_gyp (node "C:\Users\michael liu\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Users\michael liu\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
detection.cpp
deviceList.cpp
detection_win.cpp
win_delay_load_hook.cc
..\src\detection_win.cpp(5): fatal error C1083: Cannot open include file: 'atlstr.h': No such file or directory [C:\Users\michael liu\Desktop\IBSMK\ibsmk\node_modules\usb-detection\build\detection.vcxproj]
..\src\detection.cpp(60): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\michael liu\Desktop\IBSMK\ibsmk\node_modules\usb-detection\build\detection.vcxproj]
C:\Users\michael liu\Desktop\IBSMK\ibsmk\node_modules\usb-detection\node_modules\nan\nan.h(1740): note: see declaration of 'Nan::Callback::Call'
..\src\detection.cpp(105): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\michael liu\Desktop\IBSMK\ibsmk\node_modules\usb-detection\build\detection.vcxproj]
C:\Users\michael liu\Desktop\IBSMK\ibsmk\node_modules\usb-detection\node_modules\nan\nan.h(1740): note: see declaration of 'Nan::Callback::Call'
..\src\detection.cpp(195): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\michael liu\Desktop\IBSMK\ibsmk\node_modules\usb-detection\build\detection.vcxproj]
C:\Users\michael liu\Desktop\IBSMK\ibsmk\node_modules\usb-detection\node_modules\nan\nan.h(1740): note: see declaration of 'Nan::Callback::Call'
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\michael liu\AppData\Roaming\npm\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:240:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\michael liu\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\michael liu\Desktop\IBSMK\ibsmk\node_modules\usb-detection
gyp ERR! node -v v10.11.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN IBSMK#1.5.5 No repository field.
npm WARN IBSMK#1.5.5 No license 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":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! usb-detection#4.3.0 install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the usb-detection#4.3.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! C:\Users\michael liu\AppData\Roaming\npm-cache\_logs\2019-07-30T02_53_24_589Z-debug.log
There was a bunch of problems around the time of Node v10 and Electron
v3 wrt it not reporting to node-abi the right ABI version. The
solution seemed to be "don't use Node v10".
Read this for more explanation

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.

Trying to install truffle on Windows 10 by "$npm install - g truffle" Got a bunch of problems

$ npm install -g truffle
npm WARN deprecated to-iso-string#0.0.2: to-iso-string has been deprecated, use #segment/to-iso-string instead.
npm WARN deprecated jade#0.26.3: Jade has been renamed to pug, please install th e latest version of pug instead of jade
npm WARN deprecated minimatch#0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
scrypt#6.0.3 preinstall C:\Users\Zachary Zhong\AppData\Roaming\npm\node_module s.staging\scrypt-b6fa2906
node node-scrypt-preinstall.js
C:\Users\Zachary Zhong\AppData\Roaming\npm\truffle -> C:\Users\Zachary Zhong\App Data\Roaming\npm\node_modules\truffle\cli.js
C:\Users\Zachary Zhong\AppData\Roaming\npm\truffle-exec -> C:\Users\Zachary Zhon g\AppData\Roaming\npm\node_modules\truffle\exec.js
scrypt#6.0.3 install C:\Users\Zachary Zhong\AppData\Roaming\npm\node_modules\t ruffle\node_modules\scrypt
node-gyp rebuild
C:\Users\Zachary Zhong\AppData\Roaming\npm\node_modules\truffle\node_modules\scr ypt>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modul es\npm\bin\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
Warning: Missing input files:
C:\Users\Zachary Zhong\AppData\Roaming\npm\node_modules\truffle\node_modules\scr ypt\build..\scrypt\win\include\config.h
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Copying scrypt/win/include/config.h to scrypt/scrypt-1.2.0/config.h
The system cannot find the file specified.
TRACKER : error TRK0005: Failed to locate: "CL.exe". The system cannot find the file specified. [C:\Users\Zachary Zhong\AppData\Roaming\npm\node_modules\truffle \node_modules\scrypt\build\copied_files.vcxproj]
TRACKER : error TRK0005: Failed to locate: "CL.exe". The system cannot find the file specified. [C:\Users\Zachary Zhong\AppData\Roaming\npm\node_modules\truffle \node_modules\scrypt\build\scrypt_wrapper.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe fail ed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\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_proces s.js:215:12)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodej s\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Zachary Zhong\AppData\Roaming\npm\node_modules\truffle\nod e_modules\scrypt
gyp ERR! node -v v6.9.1
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
C:\Users\Zachary Zhong\AppData\Roaming\npm
`-- (empty)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.0.0 (node_modules\truffle\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.0.15: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "-g" "truffle"
npm ERR! node v6.9.1
npm ERR! npm v3.10.8
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! 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 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 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! C:\Users\Zachary Zhong\npm-debug.log
npm ERR! code 1
I've got 2 guides for installing on Windows:
Installing on Windows 10 using Ubuntu bash (preferred)
https://davidburela.wordpress.com/2017/05/12/how-to-install-truffle-testrpc-on-ubuntu-or-windows-10-with-windows-subsystem-for-linux/
Installing on Windows
https://davidburela.wordpress.com/2016/11/18/how-to-install-truffle-testrpc-on-windows-for-blockchain-development/
Given that you have not include any details about your dev environment, see this StackOverflow thread that discusses the same problem as yours: node gyp error TRACKER : error TRK0005: Failed to locate: "CL.exe". The system cannot find the file specified