espruino / EspruinoTools

JavaScript library of tools for Espruino - used for the Web IDE, CLI, etc.
Apache License 2.0
150 stars 89 forks source link

errors when installing on windows #120

Open OmegaRogue opened 4 years ago

OmegaRogue commented 4 years ago

When i run npm i -g espruino i get the errors:

gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\OmegaRogue\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Windows_NT 10.0.19041
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\OmegaRogue\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\OmegaRogue\AppData\Roaming\npm\node_modules\espruino\node_modules\winnus
gyp ERR! node -v v13.12.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN rollup-plugin-commonjs@10.1.0 requires a peer of rollup@>=1.12.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: winnus@0.0.6 (node_modules\espruino\node_modules\winnus):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: winnus@0.0.6 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
gfwilliams commented 4 years ago

By the look of it, it's winnus that has failed? You can probably still use it without that if you need.

Does npm install -g windows-build-tools first help?

OmegaRogue commented 4 years ago

By the look of it, it's winnus that has failed? You can probably still use it without that if you need.

Does npm install -g windows-build-tools first help?

i still get the same error, and when i run it, it says no ports found. I need to use it with Bluetooth for my Banglejs

ilyapavkin commented 4 years ago

Got similar error. Apparently node reference outdated. Fix: https://github.com/ilyapavkin/winnus/commit/c880fd30fc4ed45cc7f3daefbfdc882bbd989f1b node 12.18.3 vs2019

gfwilliams commented 4 years ago

Thanks! Just pulled in those changes...

OmegaRogue commented 3 years ago

I just tried installing again and it still fails to build winnus

gfwilliams commented 3 years ago

Node.js probably updated again. It seems basically every new Node.js version they introduce some breaking change to the API :(

OmegaRogue commented 3 years ago

Maybe it would help to specify what Version of node and npm this requires to work, then people can just switch to that with nvm when they need to use this

skittleson commented 2 years ago

I solved my problem by using the LTS version NODE. Build tools seem to be included in NODE 17.* which looks like it can cause it to hang. Works on Windows 10 and 11. Also, add --no-ble param when sending a file via espruino command line