Topojson build fails in Windows - node.js

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.

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

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

NodeJS 5 errors while installing npm packages

Since I installed node 5.0.0, I start getting errors while installing most of npm packages.
it never happened before when I had node 4.x.
after
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "C:\Program Files\Python27\python.exe", you can set the PYTHON env variable.
gyp ERR! stack at failNoPython (c:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:116:14)
gyp ERR! stack at c:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:71:11
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:82:15)
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\AppData\Roaming\npm\node_modules\ember-cli\node_modules\bufferutil
gyp ERR! node -v v5.0.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm ERR! Windows_NT 10.0.10240
basically there's 2 main errors.
The first is asking for python.
The second is asking for .Net SDK 2.0.
after getting python 2.7.10 installed the first error disappeared. but I couldn't pass the MSbuild.exe error even after installing .Net SDK.
Is this happening with everyone?
Do I have to install Visual Studio to get node.js and NPM to work?
I prefer not to. Any alternative way?
I tried a clean installation, restarted my PC and installed it again, same errors.
Update
Now I installed both Python and VS2015, the previous errors are gone but I have this error
c:\Users\Murhaf\Desktop\sage\node_modules\bufferutil\build\bufferutil.vcxproj(20,3): error MSB4019: The imported projec
t "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Default.props" was not found. Confirm that the
path in the <Import> declaration is correct, and that the file exists on disk.
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\bufferutil
gyp ERR! node -v v5.0.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN install:bufferutil bufferutil#1.2.1 install: `node-gyp rebuild`
npm WARN install:bufferutil Exit status 1
you need Visual Studio and Python to install modules with binary components on windows, which probably means the module you are trying to install has binary components, so try to install it after Visual studio and Python.
npm install --msvs_version=2013 should work.
I am having problems with VS2015, too.

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

'gyp' filed with exit code: 1 when trying to install zookeeper on window using npm

I am try to install Zookeeper 3.4.5 on Windows 7 using npm 1.3.9. When I enter
npm install zookeeper
I get
File "C:\Program Files\npm-1.3.9\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\MSVSProject.py", line 181, in AddFileConfig
raise ValueError('AddFileConfig: file "%s" not in project.' % path)
ValueError: AddFileConfig: file "." not in project.
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Program Files\npm-1.3.9\node_modules\npm\node_modules\node-gyp\lib\configure.js:424:16)
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.1.7601
gyp ERR! command "node" "C:\\Program Files\\npm-1.3.9\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Program Files\Zookeeper-3.4.5\node_modules\zookeeper
gyp ERR! node -v v0.10.17
gyp ERR! node-gyp -v v0.10.9
gyp ERR! not ok
npm ERR! weird error 1
npm ERR! not ok code 0
As this has been a huge and annoying problem, that I have solved in many different (non-permanent ways), I FINALLY found the answer here:
Error installing node-gyp on ubuntu
Since you are on Windows, try using a previous version of Python (for me it was using 2.6) for Windows.
Try this node-gyp installation. It's works for me.
Was enough:
npm install --global --production windows-build-tools

Resources