mapbox / node-or-tools

Node.js bindings for or-tools vehicle routing problems
MIT License
146 stars 48 forks source link

[HELP] Can't install node-or-tools on Win10, cmd error #50

Closed jimcarst closed 6 years ago

jimcarst commented 6 years ago

Hi,

Something is preventing me from installing node-or-tools and I can't seem to figure out what. I try running it on Windows 10 64bit in Powershell. I tried it both with node v8.10 and v6.13.1 installed. I already solved an issue with the python PATH settings, as well as with C++ VS 15 tools. I have node-gyp and node-pre-gyp installed using npm. I also tried installing without the msvsversion2015 flag.

My error log is as follows:

PS C:\Users\...> npm install node_or_tools --msvs_version=2015

> node_or_tools@1.0.5 install C:\Users\...\node_modules\node_or_tools
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/node_or_tools/v1.0.5/Release/node-v48-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for node_or_tools@1.0.5 and node@6.13.1 (node-v48 ABI) (falling back to source compile with node-gyp)

C:\Users\...\node_modules\node_or_tools>if not defined npm_config_node_gyp (node "C:\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" clean )  else (node "" clean )

C:\Users\...\node_modules\node_or_tools>if not defined npm_config_node_gyp (node "C:\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" configure --fallback-to-build --module=C:\Users\...\node_modules\node_or_tools\lib\binding\node_or_tools.node --module_name=node_or_tools --module_path=C:\Users\...\node_modules\node_or_tools\lib\binding --python=C:\Python\Python27\python.exe --msvs_version=2015 )  else (node "" configure --fallback-to-build --module=C:\Users\...\node_modules\node_or_tools\lib\binding\node_or_tools.node --module_name=node_or_tools --module_path=C:\Users\...\node_modules\node_or_tools\lib\binding --python=C:\Python\Python27\python.exe --msvs_version=2015 )

C:\Users\...\node_modules\node_or_tools>if not defined npm_config_node_gyp (node "C:\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" build --fallback-to-build --module=C:\Users\...\node_modules\node_or_tools\lib\binding\node_or_tools.node --module_name=node_or_tools --module_path=C:\Users\...\node_modules\node_or_tools\lib\binding )  else (node "" build --fallback-to-build --module=C:\Users\...\node_modules\node_or_tools\lib\binding\node_or_tools.node --module_name=node_or_tools --module_path=C:\Users\...\node_modules\node_or_tools\lib\binding )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  install-deps
  The system cannot find the specified path.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exi
ted with code 1. [C:\Users\...\node_modules\node_or_tools\build\action_before_build.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:\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:219:12)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "C:\\nodejs\\node.exe" "C:\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "build" "--fallback-to-build" "--module=C:\\Users\\...\\node_modules\\node_or_tools\\lib\\binding\\node_or_tools.node" "--module_name=node_or_tools" "--module_path=C:\\Users\\...\\node_modules\\node_or_tools\\lib\\binding"
gyp ERR! cwd C:\Users\...\node_modules\node_or_tools
gyp ERR! node -v v6.13.1
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp.cmd build --fallback-to-build --module=C:\Users\...\node_modules\node_or_tools\lib\binding\node_or_tools.node --module_name=node_or_tools --module_path=C:\Users\...\node_modules\node_or_tools\lib\binding' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\...\node_modules\node_or_tools\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:920:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
node-pre-gyp ERR! System Windows_NT 10.0.16299
node-pre-gyp ERR! command "C:\\nodejs\\node.exe" "C:\\Users\\...\\node_modules\\node_or_tools\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\...\node_modules\node_or_tools
node-pre-gyp ERR! node -v v6.13.1
node-pre-gyp ERR! node-pre-gyp -v v0.6.36
node-pre-gyp ERR! not ok
Failed to execute 'node-gyp.cmd build --fallback-to-build --module=C:\Users\...\node_modules\node_or_tools\lib\binding\node_or_tools.node --module_name=node_or_tools --module_path=C:\Users\...\node_modules\node_or_tools\lib\binding' (1)
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\...\package.json'
npm WARN ... No description
npm WARN ... No repository field.
npm WARN ... No README data
npm WARN ... No license field.
npm ERR! Windows_NT 10.0.16299
npm ERR! argv "C:\\nodejs\\node.exe" "C:\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "node_or_tools" "--msvs_version=2015"
npm ERR! node v6.13.1
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! node_or_tools@1.0.5 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node_or_tools@1.0.5 install script 'node-pre-gyp install --fallback-to-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 node_or_tools package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs node_or_tools
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls node_or_tools
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\...\npm-debug.log

If necessary I can provide the debug.log file.

I hope that anyone could help me out on this, since I suspect the solution should be simple.

daniel-j-h commented 6 years ago

I don't think anyone has tested Windows builds before. You have to figure out why the build process fails (build in verbose mode) and then adapt it for Windows.

To be clear: you are on your own on Windows. We are only running and testing this on Linux and macOS. I don't see why it should not be possible to build this project under Windows but you will probably need to adapt a couple of things.

jimcarst commented 6 years ago

Thanks for your reply. I managed to get the tools to work in the Windows Subsystem for Linux easily. I don't think I am able to adapt the tools to Windows myself, so I will not try that. If anyone has tried it though, and succeeded I will be glad to hear it.