npm install fail on windows 10
See original GitHub issueHi, I got some error during install bleno
and I found that might be some issue about installing usb module.
lenovo-PC:bleno$ npm install usb
> usb@1.1.1 install C:\Users\lenovo\Documents\node\bleno\node_modules\usb
> node-pre-gyp install --fallback-to-build
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
core.c
descriptor.c
hotplug.c
io.c
C:\Users\lenovo\Documents\node\bleno\node_modules\usb\libusb\libusb\os/threads_windows.h(47): error C2011: 'timespec':
'struct' type redefinition (compiling source file ..\libusb\libusb\descriptor.c) [C:\Users\lenovo\Documents\node\bleno\
node_modules\usb\build\libusb.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\time.h(39): note: see declaration of 'timespec' (com
piling source file ..\libusb\libusb\descriptor.c)
C:\Users\lenovo\Documents\node\bleno\node_modules\usb\libusb\libusb\os/threads_windows.h(47): error C2011: 'timespec':
'struct' type redefinition (compiling source file ..\libusb\libusb\io.c) [C:\Users\lenovo\Documents\node\bleno\node_mod
ules\usb\build\libusb.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\time.h(39): note: see declaration of 'timespec' (com
piling source file ..\libusb\libusb\io.c)
..\libusb\libusb\io.c(1227): warning C4244: '=': conversion from 'time_t' to 'long', possible loss of data [C:\Users\le
novo\Documents\node\bleno\node_modules\usb\build\libusb.vcxproj]
C:\Users\lenovo\Documents\node\bleno\node_modules\usb\libusb\libusb\os/threads_windows.h(47): error C2011: 'timespec':
'struct' type redefinition (compiling source file ..\libusb\libusb\hotplug.c)strerror.c [C:\Users\lenovo\Documents\node
\bleno\node_modules\usb\build\libusb.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\time.h(39): note: see declaration of 'timespec' (com
piling source file ..\libusb\libusb\hotplug.c)..\libusb\libusb\io.c(1902): warning C4244: '=': conversion from 'time_
t' to 'long', possible loss of data
..\libusb\libusb\io.c(2435): warning C4244: '=': conversion from 'time_t' to 'long', possible loss of data [C:\Users\le
novo\Documents\node\bleno\node_modules\usb\build\libusb.vcxproj]
C:\Users\lenovo\Documents\node\bleno\node_modules\usb\libusb\libusb\os/threads_windows.h(47): error C2011: 'timespec':
'struct' type redefinition (compiling source file ..\libusb\libusb\core.c) [C:\Users\lenovo\Documents\node\bleno\node_m
odules\usb\build\libusb.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\time.h(39): note: see declaration of 'timespec' (com
piling source file ..\libusb\libusb\core.c)sync.c
poll_windows.c
threads_windows.c
C:\Users\lenovo\Documents\node\bleno\node_modules\usb\libusb\libusb\os/threads_windows.h(47): error C2011: 'timespec':
'struct' type redefinition (compiling source file ..\libusb\libusb\strerror.c) [C:\Users\lenovo\Documents\node\bleno\no
de_modules\usb\build\libusb.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\time.h(39): note: see declaration of 'timespec' (com
piling source file ..\libusb\libusb\strerror.c)
windows_usb.c
C:\Users\lenovo\Documents\node\bleno\node_modules\usb\libusb\libusb\os/threads_windows.h(47): error C2011: 'timespec':
'struct' type redefinition (compiling source file ..\libusb\libusb\sync.c) [C:\Users\lenovo\Documents\node\bleno\node_m
odules\usb\build\libusb.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\time.h(39): note: see declaration of 'timespec' (com
piling source file ..\libusb\libusb\sync.c)
C:\Users\lenovo\Documents\node\bleno\node_modules\usb\libusb\libusb\os/threads_windows.h(47): error C2011: 'timespec':
'struct' type redefinition (compiling source file ..\libusb\libusb\os\threads_windows.c)win_delay_load_hook.c [C:\Users
\lenovo\Documents\node\bleno\node_modules\usb\build\libusb.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\time.h(39): note: see declaration of 'timespec' (com
piling source file ..\libusb\libusb\os\threads_windows.c)
..\libusb\libusb\os\threads_windows.c(194): warning C4244: '=': conversion from 'time_t' to 'long', possible loss of da
ta [C:\Users\lenovo\Documents\node\bleno\node_modules\usb\build\libusb.vcxproj]
..\libusb\libusb\os\threads_windows.c(196): warning C4244: '=': conversion from 'const time_t' to 'long', possible loss
of data [C:\Users\lenovo\Documents\node\bleno\node_modules\usb\build\libusb.vcxproj]
C:\Users\lenovo\Documents\node\bleno\node_modules\usb\libusb\libusb\os/threads_windows.h(47): error C2011: 'timespec':
'struct' type redefinition (compiling source file ..\libusb\libusb\os\poll_windows.c) [C:\Users\lenovo\Documents\node\b
leno\node_modules\usb\build\libusb.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\time.h(39): note: see declaration of 'timespec' (com
piling source file ..\libusb\libusb\os\poll_windows.c)
C:\Users\lenovo\Documents\node\bleno\node_modules\usb\libusb\libusb\os/threads_windows.h(47): error C2011: 'timespec':
'struct' type redefinition (compiling source file ..\libusb\libusb\os\windows_usb.c) [C:\Users\lenovo\Documents\node\bl
eno\node_modules\usb\build\libusb.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\time.h(39): note: see declaration of 'timespec' (com
piling source file ..\libusb\libusb\os\windows_usb.c)
..\libusb\libusb\os\windows_usb.c(586): warning C4244: '=': conversion from '__int64' to 'unsigned int', possible loss
of data [C:\Users\lenovo\Documents\node\bleno\node_modules\usb\build\libusb.vcxproj]
..\libusb\libusb\os\windows_usb.c(1017): warning C4996: 'GetVersionExA': was declared deprecated [C:\Users\lenovo\Docum
ents\node\bleno\node_modules\usb\build\libusb.vcxproj]
C:\Program Files (x86)\Windows Kits\8.1\Include\um\sysinfoapi.h(433): note: see declaration of 'GetVersionExA'
..\libusb\libusb\os\windows_usb.c(1020): warning C4996: 'GetVersionExA': was declared deprecated [C:\Users\lenovo\Docum
ents\node\bleno\node_modules\usb\build\libusb.vcxproj]
C:\Program Files (x86)\Windows Kits\8.1\Include\um\sysinfoapi.h(433): note: see declaration of 'GetVersionExA'
..\libusb\libusb\os\windows_usb.c(1423): warning C4244: '=': conversion from '__int64' to 'unsigned int', possible loss
of data [C:\Users\lenovo\Documents\node\bleno\node_modules\usb\build\libusb.vcxproj]
..\libusb\libusb\os\windows_usb.c(2558): warning C4018: '<': signed/unsigned mismatch [C:\Users\lenovo\Documents\node\b
leno\node_modules\usb\build\libusb.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:\Program Files (x86)\Nodist\bin\node_modules\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_process.js:200:12)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files (x86)\\Nodist\\bin\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "build" "--fallback-to-build" "--module=C:\\Users\\lenovo\\Documents\\node\\bleno\\node_modules\\usb\\src\\binding\\usb_bindings.node" "--module_name=usb_bindings" "--module_path=C:\\Users\\lenovo\\Documents\\node\\bleno\\node_modules\\usb\\src\\binding"
gyp ERR! cwd C:\Users\lenovo\Documents\node\bleno\node_modules\usb
gyp ERR! node -v v5.3.0
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files (x86)\Nodist\bin\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\Users\lenovo\Documents\node\bleno\node_modules\usb\src\binding\usb_bindings.node --module_name=usb_bindings --module_path=C:\Users\lenovo\Documents\node\bleno\node_modules\usb\src\binding' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:\Users\lenovo\Documents\node\bleno\node_modules\usb\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:87:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:172:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:818:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
node-pre-gyp ERR! System Windows_NT 10.0.10586
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\lenovo\\Documents\\node\\bleno\\node_modules\\usb\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\lenovo\Documents\node\bleno\node_modules\usb
node-pre-gyp ERR! node -v v5.3.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.19
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files (x86)\Nodist\bin\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\Users\lenovo\Documents\node\bleno\node_modules\usb\src\binding\usb_bindings.node --module_name=usb_bindings --module_path=C:\Users\lenovo\Documents\node\bleno\node_modules\usb\src\binding' (1)
npm WARN EBUNDLEOVERRIDE Replacing bundled node_modules\usb\node_modules\node-pre-gyp with new installed version
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "usb"
npm ERR! node v5.3.0
npm ERR! npm v3.3.12
npm ERR! code ELIFECYCLE
npm ERR! usb@1.1.1 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the usb@1.1.1 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 usb 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 their info via:
npm ERR! npm owner ls usb
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\lenovo\Documents\node\bleno\npm-debug.log
lenovo-PC:bleno$
Some info I had install
- Python 2.7.11
- Visual Studio Community 2015 Edition
- node-gyp@3.2.1
- node@5.3.0
Any help or suggestion is appreciate.
Issue Analytics
- State:
- Created 8 years ago
- Comments:17 (5 by maintainers)
Top Results From Across the Web
This npm install is not working on Windows - node.js
This npm install is not working on Windows · ran it as admin, · tried npm install -g · restarted the XAMPP server...
Read more >How to fix npm install command not working
The error above happens when npm can't be found under the PATH environment variable. First, you need to make sure that npm is...
Read more >Common errors
Windows : If you're on Windows and you have a broken installation, the easiest thing to do is to reinstall node from the...
Read more >npm install is not working in Windows 10 · Issue #15719
I have installed nodejs latest on Windows 10 (64-bit) and the ... I do not understand the error in windows 10 while installing...
Read more >Step by step solution for npm install error - M220JS
Delete the package-lock. · If you see a lot of warning & error messages related to npm-gyp, run npm rebuild & this should...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Is there any “stable version” to be installed in Windows 10 and Ubuntu 14.04? I can’t install latest node-usb on both OS.
@yangpu on Ubuntu you may need
libusb-dev
andlibudev-dev