zeromq / zeromq.js

:zap: Node.js bindings to the ØMQ library
http://zeromq.github.io/zeromq.js/
MIT License
1.45k stars 209 forks source link

npm install fails on WIN #231

Open al-k21 opened 6 years ago

al-k21 commented 6 years ago

Seeing this on WIN (x64):

MSBUILD : error MSB4132: The tools version "2.0" is unrecognized. Available tools versions are "14.0", "4.0".  
stack trace ``` $ citgm zeromq info: starting | zeromq info: lookup | zeromq info: lookup-found | zeromq info: zeromq lookup-replace| https://github.com/zeromq/zeromq.js/archive/394a60a2f076131a742deb600431fdb76bb9d83b.tar.gz info: zeromq npm: | Downloading project: https://github.com/zeromq/zeromq.js/archive/394a60a2f076131a742deb600431fdb76bb9d83b.tar.gz info: zeromq npm: | Project downloaded zeromq-4.6.0.tgz info: zeromq npm: | npm install started warn: zeromq npm-install: | gyp warn: zeromq npm-install: | ERR! build error warn: | gyp ERR! warn: zeromq npm-install: | stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1 warn: | gyp ERR! stack at ChildProcess.onExit (C:\Users\jenkins\AppData\Local\Temp\usenode.jenkins\node-v6.13.0-win-x64\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23) warn: | gyp ERR! stack at emitTwo (events.js:106:13) warn: | gyp ERR! stack at ChildProcess.emit (events.js:191:7) warn: | gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:219:12) warn: | gyp ERR! System Windows_NT 10.0.15063 warn: zeromq npm-install: | gyp ERR! command "C:\\Users\\jenkins\\AppData\\Local\\Temp\\usenode.jenkins\\node-v6.13.0-win-x64\\node.exe" "C:\\Users\\jenkins\\AppData\\Local\\Temp\\usenode.jenkins\\node-v6.13.0-win-x64\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" warn: | gyp ERR! cwd C:\Users\jenkins\AppData\Local\Temp\17664e6b-28b5-43cd-95d2-4472462aa0b4\zeromq warn: | gyp ERR! node -v v6.13.0 warn: | gyp ERR! node-gyp -v v3.4.0 warn: | gyp ERR! not ok warn: zeromq npm-install: | warn: zeromq npm-install: | npm warn: zeromq npm-install: | ERR! Windows_NT 10.0.15063 warn: | npm ERR! argv "C:\\Users\\jenkins\\AppData\\Local\\Temp\\usenode.jenkins\\node-v6.13.0-win-x64\\node.exe" "C:\\Users\\jenkins\\AppData\\Local\\Temp\\usenode.jenkins\\node-v6.13.0-win-x64\\node_modules\\npm\\bin\\npm-cli.js" "install" "--loglevel" "error" warn: | npm ERR! node v6.13.0 warn: | npm ERR! npm v3.10.10 warn: | npm ERR! code ELIFECYCLE warn: | npm ERR! zeromq@4.6.0 install: `node scripts/prebuild-install.js || (node scripts/preinstall.js && node-gyp rebuild)` warn: | npm ERR! Exit status 1 warn: | npm ERR! warn: | npm warn: zeromq npm-install: | ERR! Failed at the zeromq@4.6.0 install script 'node scripts/prebuild-install.js || (node scripts/preinstall.js && node-gyp rebuild)'. warn: | npm ERR! Make sure you have the latest version of node.js and npm installed. warn: | npm ERR! If you do, this is most likely a problem with the zeromq package, warn: | npm ERR! not with npm itself. warn: | npm ERR! Tell the author that this fails on your system: warn: | npm ERR! node scripts/prebuild-install.js || (node scripts/preinstall.js && node-gyp rebuild) warn: | npm ERR! You can get information on how to open an issue for this project with: warn: | npm ERR! npm bugs zeromq warn: | npm ERR! Or if that isn't available, you can get their info via: warn: | npm ERR! npm owner ls zeromq warn: | npm ERR! There is likely additional logging output above. warn: zeromq npm-install: | npm ERR! Please include the following file with any support request: warn: | npm ERR! C:\Users\jenkins\AppData\Local\Temp\17664e6b-28b5-43cd-95d2-4472462aa0b4\zeromq\npm-debug.log error: failure | Install Failed error: failing module(s) | error: module name: | zeromq error: version: | 4.6.0 error: error: | Install Failed error: error: | undefined error: | > zeromq@4.6.0 install C:\Users\jenkins\AppData\Local\Temp\17664e6b-28b5-43cd-95d2-4472462aa0b4\zeromq error: | > node scripts/prebuild-install.js || (node scripts/preinstall.js && node-gyp rebuild) error: | error: | error: | prebuild-install info begin Prebuild-install version 2.5.1 error: | prebuild-install info install installing standalone, skipping download. error: | error: | Downloading libzmq for Windows error: | Download finished error: | error: | C:\Users\jenkins\AppData\Local\Temp\17664e6b-28b5-43cd-95d2-4472462aa0b4\zeromq>if not defined npm_config_node_gyp (node "C:\Users\jenkins\AppData\Local\Temp\usenode.jenkins\node-v6.13.0-win-x64\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild ) error: | Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. error: | MSBUILD : error MSB4132: The tools version "2.0" is unrecognized. Available tools versions are "14.0", "4.0". error: | error: | gyp ERR! build error error: | gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1 error: | gyp ERR! stack at ChildProcess.onExit (C:\Users\jenkins\AppData\Local\Temp\usenode.jenkins\node-v6.13.0-win-x64\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23) error: | gyp ERR! stack at emitTwo (events.js:106:13) error: | gyp ERR! stack at ChildProcess.emit (events.js:191:7) error: | gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:219:12) error: | gyp ERR! System Windows_NT 10.0.15063 error: | gyp ERR! command "C:\\Users\\jenkins\\AppData\\Local\\Temp\\usenode.jenkins\\node-v6.13.0-win-x64\\node.exe" "C:\\Users\\jenkins\\AppData\\Local\\Temp\\usenode.jenkins\\node-v6.13.0-win-x64\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" error: | gyp ERR! cwd C:\Users\jenkins\AppData\Local\Temp\17664e6b-28b5-43cd-95d2-4472462aa0b4\zeromq error: | gyp ERR! node -v v6.13.0 error: | gyp ERR! node-gyp -v v3.4.0 error: | gyp ERR! not ok error: | error: | npm ERR! Windows_NT 10.0.15063 error: | npm ERR! argv "C:\\Users\\jenkins\\AppData\\Local\\Temp\\usenode.jenkins\\node-v6.13.0-win-x64\\node.exe" "C:\\Users\\jenkins\\AppData\\Local\\Temp\\usenode.jenkins\\node-v6.13.0-win-x64\\node_modules\\npm\\bin\\npm-cli.js" "install" "--loglevel" "error" error: | npm ERR! node v6.13.0 error: | npm ERR! npm v3.10.10 error: | npm ERR! code ELIFECYCLE error: | npm ERR! zeromq@4.6.0 install: `node scripts/prebuild-install.js || (node scripts/preinstall.js && node-gyp rebuild)` error: | npm ERR! Exit status 1 error: | npm ERR! error: | npm ERR! Failed at the zeromq@4.6.0 install script 'node scripts/prebuild-install.js || (node scripts/preinstall.js && node-gyp rebuild)'. error: | npm ERR! Make sure you have the latest version of node.js and npm installed. error: | npm ERR! If you do, this is most likely a problem with the zeromq package, error: | npm ERR! not with npm itself. error: | npm ERR! Tell the author that this fails on your system: error: | npm ERR! node scripts/prebuild-install.js || (node scripts/preinstall.js && node-gyp rebuild) error: | npm ERR! You can get information on how to open an issue for this project with: error: | npm ERR! npm bugs zeromq error: | npm ERR! Or if that isn't available, you can get their info via: error: | npm ERR! npm owner ls zeromq error: | npm ERR! There is likely additional logging output above. error: | error: | npm ERR! Please include the following file with any support request: error: | npm ERR! C:\Users\jenkins\AppData\Local\Temp\17664e6b-28b5-43cd-95d2-4472462aa0b4\zeromq\npm-debug.log error: done | The smoke test has failed. info: duration | test duration: 66372ms ```

Following the discussion in here https://github.com/chjj/pty.js/issues/60#issuecomment-284125481, and setting `npm config set msvs_version 2012 --global` solves the issue. **NOTE:** `npm config set msvs_version 2015 --global` also works. Do you know why is this happening ?
al-k21 commented 6 years ago

Do you know why setting msvs_version is required? @lgeiger @rgbkrk

rgbkrk commented 6 years ago

Originally this was to align with windows-build-tools. I don't know if we have to be explicit about the msvs_version or just that we were requiring a newer visual studio version than the old version of this project (that used to check DLLs into the source tree...)

bzoz commented 6 years ago

msvs_version is used to tell gyp (used by node-gyp) what PlatformToolset to use

aminya commented 1 month ago

v6 was released. Please try again with the latest version, and report back if the issue still persists. https://github.com/zeromq/zeromq.js/releases/tag/v6.0.0