Closed GeorgeIoak closed 7 years ago
Hi George, the sleep
module, which node-orvibo uses when you try and set up new sockets, is failing to build, which usually means that you're missing some kind of build tool on your local computer.
Try following the steps outlined here and let me know how you go.
Hi David, thanks for the help. My PC already has Visual Studio 2015 installed. Here's what happens if I follow Option 1
C:\Windows\system32>npm install --global --production windows-build-tools
npm WARN engine windows-build-tools@1.1.0: wanted: {"node":">=4.0.0"} (current: {"node":"0.12.7","npm":"2.11.3"})
npm WARN engine request@2.79.0: wanted: {"node":">= 4"} (current: {"node":"0.12.7","npm":"2.11.3"})
-
> windows-build-tools@1.1.0 postinstall C:\Users\George\AppData\Roaming\npm\node_modules\windows-build-tools
> node ./lib/index.js
Downloading BuildTools_Full.exe
Downloading python-2.7.11.msi
[============================================>] 100.0% of 18.64 MB (12.42 MB/s)
Downloaded python-2.7.11.msi. Saved to C:\Users\George\.windows-build-tools\python-2.7.11.msi.
Starting installation...
events.js:85
throw er; // Unhandled 'error' event
^
Error: spawn powershell.exe ENOENT
at exports._errnoException (util.js:746:11)
at Process.ChildProcess._handle.onexit (child_process.js:1053:32)
at child_process.js:1144:20
at process._tickCallback (node.js:355:11)
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "D:\\Program Files\\nodejs\\\\node.exe" "D:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--global" "--production" "windows-build-tools"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! code ELIFECYCLE
npm ERR! windows-build-tools@1.1.0 postinstall: `node ./lib/index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the windows-build-tools@1.1.0 postinstall script 'node ./lib/index.js'.
npm ERR! This is most likely a problem with the windows-build-tools package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./lib/index.js
npm ERR! You can get their info via:
npm ERR! npm owner ls windows-build-tools
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Windows\system32\npm-debug.log
hmm, a few things:
Error: spawn powershell.exe ENOENT
node -v
Hopefully that is enough to get step 1 to complete, and hopefully to run node-orvibo!
I’ll go ahead and document this in case someone else happens to run across this issue.
I was running from an elevated cmd prompt (search for cmd, right click, select Run as Administrator)
C:\Windows\system32>node -v
v0.12.7
C:\Windows\system32>npm cache clean -f
npm WARN using --force I sure hope you know what you are doing.
C:\Windows\system32>npm install -g n
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "D:\\Program Files\\nodejs\\\\node.exe" "D:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "n"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported
npm ERR! notsup Not compatible with your operating system or architecture: n@2.1.4
npm ERR! notsup Valid OS: !win32
npm ERR! notsup Valid Arch: any
npm ERR! notsup Actual OS: win32
npm ERR! notsup Actual Arch: x64
npm ERR! Please include the following file with any support request:
npm ERR! C:\Windows\system32\npm-debug.log
C:\Windows\system32>npm install -g npm-windows-upgrade
-
> spawn-sync@1.0.15 postinstall C:\Users\George\AppData\Roaming\npm\node_modules\npm-windows-upgrade\node_modules\inquirer\node_modules\external-editor\node_modules\spawn-sync
> node postinstall
C:\Users\George\AppData\Roaming\npm\npm-windows-upgrade -> C:\Users\George\AppData\Roaming\npm\node_modules\npm-windows-upgrade\bin\npm-windows-upgrade.js
npm WARN unmet dependency C:\Users\George\AppData\Roaming\npm\node_modules\particle-cli\node_modules\serialport\node_modules\node-pre-gyp\node_modules\tar-pack requires debug@'~2.2.0' but will load
npm WARN unmet dependency C:\Users\George\AppData\Roaming\npm\node_modules\particle-cli\node_modules\serialport\node_modules\debug,
npm WARN unmet dependency which is version 2.6.0
npm-windows-upgrade@3.1.1 C:\Users\George\AppData\Roaming\npm\node_modules\npm-windows-upgrade
├── cli-spinner@0.2.5
├── commander@2.9.0 (graceful-readlink@1.0.1)
├── chalk@1.1.3 (escape-string-regexp@1.0.5, supports-color@2.0.0, ansi-styles@2.2.1, strip-ansi@3.0.1, has-ansi@2.0.0)
├── promise@7.1.1 (asap@2.0.5)
├── prompt@1.0.0 (revalidator@0.1.8, pkginfo@0.4.0, colors@1.1.2, read@1.0.7, winston@2.1.1, utile@0.3.0)
├── regenerator-runtime-only@0.8.38 (promise@6.1.0, es6-symbol@2.0.1)
├── inquirer@1.2.3 (ansi-escapes@1.4.0, mute-stream@0.0.6, through@2.3.8, strip-ansi@3.0.1, cli-width@2.1.0, figures@1.7.0, run-async@2.3.0, pinkie-promise@2.0.1, string-width@1.0.2, cli-cursor@1.0.2, external-editor@1.1.1, rx@4.1.0, lodash@4.17.4)
└── babel-polyfill@6.20.0 (regenerator-runtime@0.10.1, babel-runtime@6.20.0, core-js@2.4.1)
C:\Windows\system32>npm-windows-upgrade
npm-windows-upgrade v3.1.1
events.js:85
throw er; // Unhandled 'error' event
^
Error: spawn powershell.exe ENOENT
at exports._errnoException (util.js:746:11)
at Process.ChildProcess._handle.onexit (child_process.js:1053:32)
at child_process.js:1144:20
at process._tickCallback (node.js:355:11)
at Function.Module.runMain (module.js:503:11)
at startup (node.js:129:16)
at node.js:814:3
C:\Windows\system32>
So at this point I decided to try using an elevated Powershell and follow instructions from https://github.com/felixrieseberg/npm-windows-upgrade
Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.
PS C:\Windows\system32> Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
PS C:\Windows\system32> npm install --global --production npm-windows-upgrade
\
> spawn-sync@1.0.15 postinstall C:\Users\George\AppData\Roaming\npm\node_modules\npm-windows-upgrade\node_modules\inquir
er\node_modules\external-editor\node_modules\spawn-sync
> node postinstall
C:\Users\George\AppData\Roaming\npm\npm-windows-upgrade -> C:\Users\George\AppData\Roaming\npm\node_modules\npm-windows-
upgrade\bin\npm-windows-upgrade.js
npm WARN unmet dependency C:\Users\George\AppData\Roaming\npm\node_modules\particle-cli\node_modules\serialport\node_mod
ules\node-pre-gyp\node_modules\tar-pack requires debug@'~2.2.0' but will load
npm WARN unmet dependency C:\Users\George\AppData\Roaming\npm\node_modules\particle-cli\node_modules\serialport\node_mod
ules\debug,
npm WARN unmet dependency which is version 2.6.0
npm-windows-upgrade@3.1.1 C:\Users\George\AppData\Roaming\npm\node_modules\npm-windows-upgrade
├── cli-spinner@0.2.5
├── commander@2.9.0 (graceful-readlink@1.0.1)
├── chalk@1.1.3 (escape-string-regexp@1.0.5, ansi-styles@2.2.1, supports-color@2.0.0, has-ansi@2.0.0, strip-ansi@3.0.1)
├── promise@7.1.1 (asap@2.0.5)
├── prompt@1.0.0 (revalidator@0.1.8, colors@1.1.2, pkginfo@0.4.0, read@1.0.7, winston@2.1.1, utile@0.3.0)
├── regenerator-runtime-only@0.8.38 (promise@6.1.0, es6-symbol@2.0.1)
├── inquirer@1.2.3 (ansi-escapes@1.4.0, mute-stream@0.0.6, through@2.3.8, strip-ansi@3.0.1, pinkie-promise@2.0.1, figure
s@1.7.0, run-async@2.3.0, cli-width@2.1.0, cli-cursor@1.0.2, string-width@1.0.2, external-editor@1.1.1, rx@4.1.0, lodash
@4.17.4)
└── babel-polyfill@6.20.0 (regenerator-runtime@0.10.1, babel-runtime@6.20.0, core-js@2.4.1)
PS C:\Windows\system32> npm-windows-upgrade
npm-windows-upgrade v3.1.1
? Which version do you want to install? 4.1.2
Checked system for npm installation:
According to PowerShell: D:\Program Files\nodejs
According to npm: C:\Users\George\AppData\Roaming\npm
Decided that npm is installed in D:\Program Files\nodejs
Upgrading npm... \
Upgrade finished. Your new npm version is 4.1.2. Have a nice day!
PS C:\Windows\system32> node -v
v0.12.7
PS C:\Windows\system32>
I found that to upgrade node you "have" to install it again, or at least that's what I found from http://exponential.io/blog/install-or-upgrade-nodejs-on-windows/
so in the Powershell command window I did that and the results from that can be viewed here:
http://pastebin.com/hJvJvS2P
but the short answer is that it was successful.
I then went back to the original elevated command prompt window (not the Powershell) and that now appeared to be successful, the details can be found at http://pastebin.com/qxSGMJ3N
Feeling goo I decided to try npm install --save node-orvibo
again but I seemed to get the same errors as before. I haven't rebooted
C:\Windows\system32>npm install --save node-orvibo
> sleep@3.0.1 install C:\Windows\system32\node_modules\sleep
> node-gyp rebuild
C:\Windows\system32\node_modules\sleep>if not defined npm_config_node_gyp (node "D:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
gyp: binding.gyp not found (cwd: C:\Windows\system32\node_modules\sleep) while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:305:16)
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:215:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "D:\\Program Files\\nodejs\\node.exe" "D:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Windows\system32\node_modules\sleep
gyp ERR! node -v v6.9.4
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
C:\Windows\system32
+-- args-js@0.10.12
+-- debug@2.6.0
| `-- ms@0.7.2
+-- ip@1.1.4
+-- jonah@0.0.2
+-- lodash@3.10.1
`-- validator@4.9.0
`-- depd@1.1.0
npm WARN enoent ENOENT: no such file or directory, open 'C:\Windows\system32\package.json'
npm WARN system32 No description
npm WARN system32 No repository field.
npm WARN system32 No README data
npm WARN system32 No license field.
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "D:\\Program Files\\nodejs\\node.exe" "D:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save" "node-orvibo"
npm ERR! node v6.9.4
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! sleep@3.0.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sleep@3.0.1 install script 'node-gyp rebuild'.
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 sleep package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs sleep
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls sleep
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Windows\system32\npm-debug.log
C:\Windows\system32>
Looking at this a little closer I saw something that might be pointing to the cause:
382 warn enoent ENOENT: no such file or directory, open 'C:\Windows\system32\package.json'
383 verbose enoent ENOENT: no such file or directory, open 'C:\Windows\system32\package.json'
383 verbose enoent This is most likely not a problem with npm itself
383 verbose enoent and is related to npm not being able to find a file.
When I search my system I can find many package.json files. I do have node installed on my D Drive which is probably a little unique and maybe something is hard code to only look on the C Drive?
Not really sure of the exact issues but everything appears to be installed now. I opened an elevated Powershell window and changed to where the node_modules directory is (D:\ProgramFiles\nodejs\node_modules\npm
I uninstalled the sleep module npm uninstall sleep
and then reinstalled it
I then ran npm install -g node-gyp
And finally npm install --save node-orvibo
No errors were reported so I'm hoping that this ia ll installed properly now!
Now I need to find the time to study the code and my goal is to create an app that can be controlled through Amazon Alexa
Glad to hear you got it working. For future reference, run the npm install
command outside of system32. You'll want to run the command in the same folder as your project (e.g. C:\Users\George\Documents\OrviboProject), because installing a package installs it for that project, and not globally (some packages can be installed globally, this isn't one of them because it's a library, not an application)
If you get something up and running (and the code is open source), let me know. I'm working on node-orvibo2 (which will handle newer Orvibo devices such as the Coco, Kepler and the updated version of the S20 socket), and might start featuring projects that use this code, as there's some home automation drivers for things like SmartThings and node-red.
D:\ioBroker\node_modules\iobroker.orvibo\node_modules\node-orvibo\node_modules\s
leep>if not defined npm_config_node_gyp (node "C:\Program Files (x86)\nodejs\nod
e_modules\npm\bin\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" reb
uild ) else (node "" rebuild )
Сборка проектов в этом решении по одному. Чтобы включить параллельную сборку, до
бавьте параметр "/m".
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.t
argets(55,5): error MSB8020: The build tools for Visual Studio 2010 (Platform T
oolset = 'v100') cannot be found. To build using the v100 build tools, please i
nstall Visual Studio 2010 build tools. Alternatively, you may upgrade to the c
urrent Visual Studio tools by selecting the Project menu or right-click the sol
ution, and then selecting "Retarget solution". [D:\ioBroker\node_modules\iobrok
er.orvibo\node_modules\node-orvibo\node_modules\sleep\build\node_sleep.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe
fail
ed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files (x86)\nodejs\node_mo
dules\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_proces
s.js:211:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files
(x86)\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "reb
uild"
gyp ERR! cwd D:\ioBroker\node_modules\iobroker.orvibo\node_modules\node-orvibo\n
ode_modules\sleep
gyp ERR! node -v v4.6.2
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x8
6)\nodejs\node_modules\npm\bin\npm-cli.js" "install"
npm ERR! node v4.6.2
npm ERR! npm v2.15.11
npm ERR! code ELIFECYCLE
npm ERR! sleep@3.0.1 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sleep@3.0.1 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the sleep package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs sleep
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls sleep
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request: npm ERR! D:\ioBroker\node_modules\iobroker.orvibo\npm-debug.log
D:\ioBroker\node_modules\iobroker.orvibo>npm install -g node-gyp C:\Users\instalator\AppData\Roaming\npm\node-gyp -> C:\Users\instalator\AppData\ Roaming\npm\node_modules\node-gyp\bin\node-gyp.js node-gyp@3.5.0 C:\Users\instalator\AppData\Roaming\npm\node_modules\node-gyp ├── rimraf@2.5.4 ├── semver@5.3.0 ├── graceful-fs@4.1.11 ├── osenv@0.1.4 (os-tmpdir@1.0.2, os-homedir@1.0.2) ├── which@1.2.12 (isexe@1.1.2) ├── fstream@1.0.10 (inherits@2.0.3) ├── nopt@3.0.6 (abbrev@1.0.9) ├── minimatch@3.0.3 (brace-expansion@1.1.6) ├── glob@7.1.1 (path-is-absolute@1.0.1, fs.realpath@1.0.0, inherits@2.0.3, infli ght@1.0.6, once@1.4.0) ├── mkdirp@0.5.1 (minimist@0.0.8) ├── tar@2.2.1 (inherits@2.0.3, block-stream@0.0.9) ├── npmlog@4.0.2 (console-control-strings@1.1.0, set-blocking@2.0.0, are-we-ther e-yet@1.1.2, gauge@2.7.2) └── request@2.79.0 (tunnel-agent@0.4.3, aws-sign2@0.6.0, oauth-sign@0.8.2, is-ty pedarray@1.0.0, forever-agent@0.6.1, caseless@0.11.0, stringstream@0.0.5, aws4@1 .5.0, isstream@0.1.2, json-stringify-safe@5.0.1, extend@3.0.0, uuid@3.0.1, qs@6. 3.0, combined-stream@1.0.5, mime-types@2.1.14, tough-cookie@2.3.2, form-data@2.1 .2, hawk@3.1.3, http-signature@1.1.1, har-validator@2.0.6)
@instalator: Have you followed the steps here: https://github.com/nodejs/node-gyp#installation ?
This error should also give you a clue: The build tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found
. Installing the build tools for VS2010 should fix the issue.
If that doesn't work, let me know what you have tried, so we can narrow down what the issue is.
I have done all the steps, but did not help. I had to install extra https://developer.microsoft.com/en-us/windows/downloads/windows-8-1-sdk. Only after this has been set node-orvibo.
Sorry I didn't get back to you about this, so it's working correctly now?
Yes, but I'm waiting for the second version of the module.
That might take a while, as it won't be truly ready until the new Orvibo devices are supported, and right now it looks like I've got a long battle ahead.
So my recommendation is to fork the source, comment out anything that uses sleep
, remove sleep from package.json
and then use your fork.
i just ran "npm install --save node-orvibo" on my Win7 x64 PC and I received this error. I'm new to node so I'm not sure how to proceed with debugging this error.
The full contents of what happened are: