Getting NodeJS to work with VS2015 - node.js

I have problem installing npm packages, I'm using NodeJS 5.0.0.
I have Python 2.7.3 and Visual Studio 2015 installed on my machine. I had a problem getting VS2015 to work with Node before,
error MSB4019: The imported project "...\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Default.props" was not found
after I fixed it by changing the required path value to V140 (to point to VS2015 directory). Now I get a this error:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(366,5): warning MSB8003: Could not fi
nd WindowsSDKDir variable from the registry. TargetFrameworkVersion or PlatformToolset may be set to an invalid versio
n number. [c:\Users\Murhaf\Desktop\sage\node_modules\utf-8-validate\build\validation.vcxproj]
TRACKER : error TRK0005: Failed to locate: "CL.exe". The system cannot find the file specified. [c:\Users\Murhaf\Deskto
p\sage\node_modules\utf-8-validate\build\validation.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `msbuild` 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:270:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 10.0.10240
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:\Users\Murhaf\Desktop\sage\node_modules\utf-8-validate
gyp ERR! node -v v5.0.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN install:utf-8-validate utf-8-validate#1.2.1 install: `node-gyp rebuild`
npm WARN install:utf-8-validate Exit status 1
What am I missing?

I got it work by installing Windows SDK.
First I installed Windows 10 SDK, it didn't work.
Second I installed Windows 7 SDK, it also didn't work.
lastly, I launched VS2015 uninstaller, I choice modify to add WINDOWS 8.1 SDK feature, I installed it using their VS2015 installer then it worked.
The reason in my opinion was about its registry key, but I didn't want to spend more time on it, Windows SDK 8.1 fixed the problem.

Related

Unable to install tensorflow.js

I am trying to install tensorflow.js on a windows machine using:
npm install #tensorflow/tfjs-node-gpu
I am using python 2.7 and have tried updating npm.
Whenever I do that I get the following error:
Error: node-gyp rebuild failed with: Error: Command failed: node-gyp rebuild
gyp ERR! build error
gyp ERR! stack Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.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:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:189:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Windows_NT 10.0.17134
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:\Coding\AI\node_modules\#tensorflow\tfjs-node-gpu
gyp ERR! node -v v10.15.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
I ran into the same problem on Mac. This issue on github points out that when you use this package node-gyp (which I think is a cross-platform tool used to help install Tensorflow), you need to make sure that your file path doesn't contain any spaces.
So, based on your error message, it looks like you are trying to install tensorflow in a project that is in the Program Files\ folder. node-gyp doesn't like that because you have spaces in the name. It's kind of annoying, but I fixed the problem by putting my node project in a folder without spaces, i.e. /Users/Bryce/Coding-Projects/MyProject/
This worked for me:
npm install #tensorflow/tfjs
You update npm package first:
npm update
And upgrade:
npm upgrade

npm install fails with error C2373 with vs2015 update 3

After reinstalling my machine with windows 10, setting it up with Visual Studio 2015 I encountered this error on installing my git repositories:
→ npm install fails on different projects with:
...
C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\src\win_delay_load_hook.c(34): error C2373: "__pfnDliNotifyHook2": [...]
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:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 10.0.10586
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:\Users\...\node_modules\buffertools
gyp ERR! node -v v4.4.7
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
This error stays in relation with npm, node-gyp and Visual Studio 2015 and is already fixed in node-gyp#3.4.0, but npm is still pointing to an old version. As I workaround I can propose this:
Go to your folder where npm is installed, e.g.:
C:\Program Files\nodejs\node_modules\npm
Open: package.json
Remove entry for node-gyp in bundleDependencies
Bump version number to 3.4.0 for node-gyp in dependencies
Make a npm i in this directory to install node-gyp#3.4.0 to fix the problem
Relating GitHub issues can be found here:
nodejs/node#7286
nodejs/node-gyp#956
npm/npm#13199
npm/npm#13200
Or update npm:
npm install npm -g
An alternative solution that doesn't involve messing with npm installation is to run
SET CL=-DDELAYIMP_INSECURE_WRITABLE_HOOKS %CL%
before running npm install

Issue installing strongloop on Windows 7

After attempting to install strongloop, It threw a few warnings and errors.
Command used to install was: npm install -g strongloop
Errors:
c:\users\yoel\.node-gyp\4.2.4\include\node\v8.h(336): error C2988: unrecognizable template declaration/definition [C:\Users\Yoel\AppData\Roaming\npm\node_modules\strongloop\node_modules\heapdump\build\addon.vcxproj]
c:\users\yoel\.node-gyp\4.2.4\include\node\v8.h(336): error C2059: syntax error : 'using' [C:\Users\Yoel\AppData\Roaming\npm\node_modules\strongloop\node_modules\heapdump\build\addon.vcxproj]
c:\users\yoel\.node-gyp\4.2.4\include\node\v8.h(576): error C2061: syntax error : identifier 'WeakCallbackType' [C:\Users\Yoel\AppData\Roaming\npm\node_modules\strongloop\node_mododules\heapdump\build\addon.vcxproj]
c:\users\yoel\.node-gyp\4.2.4\include\node\v8.h(915): error C2989: 'v8::HandleScope' : class template has already been declared as a non-class template [C:\Users\Yoel\AppData\Roaming\npm\node_modules\strongloop\node_modules\heapdump\build\addon.vcxproj]
.
.
.
etc... [many of the same errors and a few others]
This is the error log form builderror.log :
gyp ERR! build error
gyp ERR! stack Error: `msbuild` 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:270:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 6.1.7601
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:\Users\Yoel\AppData\Roaming\npm\node_modules\strongloop\node_modules\node-inspector\node_modules\ws
gyp ERR! node -v v4.2.4
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
I am using Node 4.2.4, Python 2.7.11 and NPM 2.14.12
Things I've tried:
reinstalling gyp
reinstalling visual studio 2012
installing strongloop with visual studio 2015
installing strongloop with visual studio 2013
installing strongloop with visual studio 2010
Any ideas? anyone else encountered a similar issue?
Note: I am able to run slc, but I have no way of knowing if everything works properly. It's not like a warning I can just ignore.
This has resolved the issue.
Step 1:
reinstall node-gyp to latest version: npm install -g node-gyp
Step 2:
run strongloop installation again like so: npm install -g strongloop --msvs_version=2012

error on npm install -g protractor

When I install protractor I get this error:
C:\Users\andreir\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\node_modules\ws\node_modules\utf-8-validate>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\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.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.InvalidPlatform.Targets(23,7): error MSB8007: The Platform for project 'validation.vcxproj' is invalid. Platform='x64'. You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Platform that doesn't exist for this project. [C:\Users\andreir\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\node_modules\ws\node_modules\utf-8-validate\build\validation.vcxproj]
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: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 Windows_NT 6.2.9200
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\andreir\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\node_modules\ws\node_modules\utf-8-validate
gyp ERR! node -v v0.10.38
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
I don't understand where the erorr is...
I have (relevant):
Windows 8.1 pro x64,
Python 2.7.10,
VS 2012 Pro
The issue, as the error is saying, is due to the compilation of utf-8-validate module required by WebSocket required by selenium-webdriver
node_modules\protractor\node_modules\selenium-webdriver\node_modules\ws\node_modules\utf-8-validate
the compiler is failing to find a project configuration for x64
The Platform for project 'validation.vcxproj' is invalid. Platform='x64'
In this Github Issue the solution was reinstalling VisualStudio and Windows SDK.
Anyway this is an optional dependency so you can do without it, while you figure it out, running
npm install --no-optional

Topojson build fails in Windows

I am trying to follow Mike's tutorial on how to create maps on - http://bost.ocks.org/mike/map/.
I have been able to use Node quite well on Windows. I am trying to install topojson with the command - "npm install -g topojson"
I am getting the error -
MSBUILD : error MSB4132: The tools version "2.0" is unrecognized. Available too
ls versions are "4.0".
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:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:
12)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modu
les\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\sumod_pawgi\AppData\Roaming\npm\node_modules\topojson\node
_modules\d3\node_modules\jsdom\node_modules\contextify
gyp ERR! node -v v0.10.16
gyp ERR! node-gyp -v v0.10.9
gyp ERR! not ok
npm ERR! weird error 1
npm ERR! not ok code 0
I am using 64-bit Windows 8.
So looks like there is some mismatch between the .NET version. How can I get the recognized tools version? Am I missing anything here?
Had a similar issue. I had python 2.5 64bit installed as part of the gdal toolkit. Uninstall all the python install's you have. Install python 2.7 x86 as well as nodejs x86. Try using npm to install topojson again.
This worked for me.

Resources