npm install x509 not working on windows 10 - windows

I am facing issue with installing npm module "x509". But getting error. I am using my Angular APP to read some x509 cert for fecthing subject info.
K:\Codes\AWS\REPOS\UI\utilities\configrestui\node_modules\x509>if not defined npm_config_node_gyp (node "C:\Program Files\n
odejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(54,5): error MSB8020: The build tool
s for Visual Studio 2012 (Platform Toolset = 'v110') cannot be found. To build using the v110 build tools, please install
Visual Studio 2012 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Projec
t menu or right-click the solution, and then selecting "Retarget solution". [K:\Codes\AWS\REPOS\UI\utilities\configrestui\
node_modules\x509\build\x509.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:\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_process.js:215:12)
gyp ERR! System Windows_NT 10.0.15063
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gy
p\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd K:\Codes\AWS\REPOS\UI\utilities\configrestui\node_modules\x509
gyp ERR! node -v v6.10.3
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.1.2: wanted {"os":"darwin","arch":"any"}
(current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.0.0 (node_modules\angular-ide\node_modules\chokidar\node_module
s\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.1.2: wanted {"os":"darwin","arch":"any"}
(current: {"os":"win32","arch":"x64"})
npm ERR! Windows_NT 10.0.15063
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "instal
l" "x509" "--save"
npm ERR! node v6.10.3
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! x509#0.3.2 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the x509#0.3.2 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 x509 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 x509
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls x509
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! K:\Codes\AWS\REPOS\UI\utilities\configrestui\npm-debug.log
I verified my installables, i dont have v110 which is VS 2012 VC ++ redistributables . I installed from MS VS VC++ build tools 2012. but still gettintg same error .

We need to install VS2012 to make this build.But I tried on ubuntu 16.04 LTS all works well.

Related

Package cairo not found in pakg-config search path

sachin#sachin-Inspiron-15-3567:~/Desktop/Projects/api.ohphish.com$ npm install
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion#1, but npm-shrinkwrap.json was generated for lockfileVersion#0. I'll try to do my best with it!
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion#1, but npm-shrinkwrap.json was generated for lockfileVersion#0. I'll try to do my best with it!
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion#1, but npm-shrinkwrap.json was generated for lockfileVersion#0. I'll try to do my best with it!
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion#1, but npm-shrinkwrap.json was generated for lockfileVersion#0. I'll try to do my best with it!
canvas#1.6.13 install /home/sachin/Desktop/Projects/api.ohphish.com/node_modules/chartjs-node/node_modules/canvas
node-gyp rebuild
Package cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing cairo.pc' to the PKG_CONFIG_PATH environment variable No package 'cairo' found gyp: Call to './util/has_lib.sh freetype' returned exit status 0 while in binding.gyp. while trying to load binding.gyp gyp ERR! configure error gyp ERR! stack Error: gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Linux 5.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" "rebuild"
gyp ERR! cwd /home/sachin/Desktop/Projects/api.ohphish.com/node_modules/chartjs-node/node_modules/canvas
gyp ERR! node -v v14.15.4
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN chartjs-node#1.7.1 requires a peer of chart.js#<=2.7.* but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#2.3.1 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.3.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! canvas#1.6.13 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the canvas#1.6.13 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
I installed dev dependencies by issueing command.
sudo apt-get install libcairo2-dev libjpeg-dev libgif-dev build-essential

VS Code "gyp ERR! find VS"

althogh I've searched to get this error solved I couldn't find any proper solution.
Visual Studio 2019 with complete C++ developer tools is installed as well as Python.
Anyhow I get this error when I install bcryptjs in VSCode:
gyp ERR! find VS
gyp ERR! find VS msvs_version was set from command line or npm config
gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer
gyp ERR! find VS looking for Visual Studio 2015
gyp ERR! find VS - not found
gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
gyp ERR! find VS
gyp ERR! find VS **************************************************************
gyp ERR! find VS You need to install the latest version of Visual Studio
gyp ERR! find VS including the "Desktop development with C++" workload.
gyp ERR! find VS For more information consult the documentation at:
gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
gyp ERR! find VS **************************************************************
gyp ERR! find VS
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Visual Studio installation to use
gyp ERR! stack at VisualStudioFinder.fail (C:\Users\BOSS\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
gyp ERR! stack at findVisualStudio2013 (C:\Users\BOSS\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16)
gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Users\BOSS\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
gyp ERR! stack at findVisualStudio2015 (C:\Users\BOSS\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14)
gyp ERR! stack at regSearchKeys (C:\Users\BOSS\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16)
gyp ERR! stack at regGetValue (C:\Users\BOSS\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7)
gyp ERR! stack at C:\Users\BOSS\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
gyp ERR! stack at ChildProcess.exithandler (child_process.js:301:5)
gyp ERR! stack at ChildProcess.emit (events.js:198:13)
gyp ERR! stack at maybeClose (internal/child_process.js:982:16)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\BOSS\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\BOSS\Coding\PROJECTS\UDEMY\NODE.JS BOOTCAMP 2020\natours\node_modules\node-pty
gyp ERR! node -v v10.22.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN natours#1.0.0 No description
npm WARN natours#1.0.0 No repository field.
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 WARN optional SKIPPING OPTIONAL DEPENDENCY: node-pty#0.9.0 (node_modules\node-pty):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-pty#0.9.0 install: `node scripts/install.js`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
Does anybody know what could be done to get rid of that error?
I've set npm config set msvs_version 2019 --global, but I still get VCINSTALLDIR not set, not running in VS Command Prompt and could not use PowerShell to find Visual Studio 2017 or newer
Btw, bcryptjs itself is getting installed but i think without some extras?
When I use yarn the whole compilation process works fine, so I think it's an annoying configuration error that I can't find.
Is there a manual way to set the VS directory?
I've tryied this solution https://stackoverflow.com/a/59882818/13609359 but with no success.
Many thanks in advance
Slevin
Well, after struggling around for more than two hours I came up with that solution:
npm install --global --production windows-build-tools
No easy way to find out that you need to install an extra package to get the compilation done (yarn gets it done out of the box as it should be).
Hopefully this solution can help others too, as it seems to be a huge problem installing packages that have a compiling process involved.
In my case npm install --global --production windows-build-tools resulted in an infinite loop as i already had visual studio installed.
So i went to my visual studio installer and from the modified option added the Desktop development with C++ (It was not added before). After successful installation all worked fine.
I previously had python installed and was using Visual Studio 2019 Community edition

appcelerator 5.1.0 ws/bufferutil build error

I tried to install appcelerator today on Win7. All I get is "Appcelerator CLI is installing or upgrading, please wait....".
installing by cli with
npm install appcelerator -g
fails with the following output. I tried installing 5.0.0 and got a different error message. Any ideas?
Finding version 5.1.0 ... OK
Validating security checksum OK
Installing ... OK
Compiling platform native modules ...
└ extract-opts/typechecker ... OK
└ bunyan/dtrace-provider ... OK
└ extract-opts/typechecker ... OK
└ socket.io-client/ws ... OK
└ appc-ldapjs/dtrace-provider ... OK
└ bunyan/dtrace-provider ... OK
└ appc-ldapjs/dtrace-provider ... OK
└ ws/bufferutil ... 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:270:23)
gyp ERR! stack at emitTwo (events.js:100:13)
gyp ERR! stack at ChildProcess.emit (events.js:185:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_proces
s.js:200:12)
gyp ERR! System Windows_NT 6.1.7601
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\Drew\.appcelerator\install\5.1.0\package\node_modules\arro
w\node_modules\appc-pubsub\node_modules\socket.io-client\node_modules\engine.io-
client\node_modules\ws\node_modules\bufferutil
gyp ERR! node -v v5.5.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\
node_modules\\npm\\bin\\npm-cli.js" "install" "bufferutil#1.2.1" "--production"
npm ERR! node v5.5.0
npm ERR! npm v3.3.12
npm ERR! code ELIFECYCLE
npm ERR! bufferutil#1.2.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bufferutil#1.2.1 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 bufferutil 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 bufferutil
npm ERR! There is likely additional logging output above.
Solved
I had to uninstall appcelerator and node.js. Then delete %APPDATA%npn and npn-cache. Then install appcelerator.
appcelerator also doesn't like it if you install jdk after installing jre.
Try to uninstall the node version. Open Appcelerator Studio, it will automatically install the node version. Next using command prompt run below commands:
npm install appcelerator -g
appc use latest
Hope this helps.
See https://www.robertkehoe.com/2015/03/fix-node-gyp-rebuild-error-on-windows/ which might help as well. Windows and node/node-gyp are a bit of a current challenge that the node community is dealing with right now.

installing d3 using npm causes contextify errors

Getting some mystifying contextify errors (but other installs seem to go fine.)
npm install d3
MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe". To fix this, 1) install the .NET Framework 2.0 SDK, 2) install
Microsoft Visual Studio 2005 or 3) add the location of the component to the system path if it is installed elsewhere.
[C:\Users\dinesh\m3\node_modules\d3\node_modules\jsdom\node_modules\contextify\build\binding.sln]
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 (x86)\nodejs\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:810:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\dinesh\m3\node_modules\d3\node_modules\jsdom\node_modules\contextify
gyp ERR! node -v v0.10.32
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
npm ERR! contextify#0.1.9 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
You've probably moved on at this point, but for future googlers:
Upgrade to D3.js v3.5.4+
jsdom is a dependency of d3, and jsdom requires contextify, which uses native modules (node-gyp). Native modules are hard to build on some platforms, so d3 made jsdom a development dependency (not installed by default) as of v3.5.4.
Related: D3.js commit and D3.js issue.

npm install xml2json fail to install

I am trying to work on PUSh notifications for Android/ios using node.js.
I am getting the below error when I try to install xml2json.
Please help me to fix it
gyp ERR! build error
gyp ERR! stack Error: not found: make
gyp ERR! stack at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:43:28)
gyp ERR! stack at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:46:29)
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/which/which.js:57:16
gyp ERR! stack at Object.oncomplete (fs.js:107:15)
gyp ERR! System Darwin 12.5.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/bertils/node_modules/xml2json/node_modules/node-expat
gyp ERR! node -v v0.10.24
gyp ERR! node-gyp -v v0.12.1
gyp ERR! not ok
npm ERR! node-expat#2.0.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-expat#2.0.0 install script.
npm ERR! This is most likely a problem with the node-expat 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 node-expat
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 12.5.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "xml2json"
npm ERR! cwd /Users/bertils
npm ERR! node -v v0.10.24
npm ERR! npm -v 1.3.21
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/bertils/npm-debug.log
npm ERR! not ok code 0
Looks like the make tool is not available on your system.
To fix this, you have 2 options:
If you have Xcode already installed:
Go to Xcode > Preferences > Downloads and install the component named "Command Line Tools". All the relevant tools will be placed in /usr/bin.
Alternative:
Go to https://developer.apple.com/downloads, sign in with your developer Apple ID and search for "Command Line Tools", then download and install the appropriate file.
I was also facing the same issue on linux rhel 7, see if it works for you too, what I found out was that I needed to install gcc libraries on my instance, so I went ahead and removed my node_modules folder and then ran the sudo yum group install "Development Tools", in your case you might want to find the brew equivalent sudo yum group install "Development Tools" or xcode-select --install, and I then ran the npm install again and it worked!
Hope this helps, for issues related to installing gcc libraries and Development tools, one can refer to this url also: Install gcc and dev tools or Mac OS install dev tools

Resources