I'm trying to build node-serialport to use in my Electron + Angular application.
npm install serialport
serialport 6.2.2
NodeJS v10.9.0
Windows 10 x64
Stack Trace:
An unhandled error occurred inside electron-rebuild
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
serialport.cpp
serialport_win.cpp
win_delay_load_hook.cc
..\src\serialport.cpp(95): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
C:\Users\User\Desktop\my-project\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call'
..\src\serialport.cpp(150): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
C:\Users\User\Desktop\my-project\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call'
..\src\serialport.cpp(188): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
C:\Users\User\Desktop\my-project\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call'
..\src\serialport.cpp(231): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
C:\Users\User\Desktop\my-project\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call'
..\src\serialport.cpp(285): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
C:\Users\User\Desktop\my-project\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call'
..\src\serialport.cpp(336): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
C:\Users\User\Desktop\my-project\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call'
..\src\serialport.cpp(383): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
C:\Users\User\Desktop\my-project\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call'
..\src\serialport.cpp(424): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
C:\Users\User\Desktop\my-project\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call'
..\src\serialport_win.cpp(188): warning C4311: 'type cast': pointer truncation from 'HANDLE' to 'int' [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(188): warning C4302: 'type cast': truncation from 'HANDLE' to 'int' [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(198): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(205): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(215): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(217): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(221): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(223): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(227): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(229): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(234): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(246): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(256): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(273): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(334): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(360): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(390): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
C:\Users\User\Desktop\my-project\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call'
..\src\serialport_win.cpp(463): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(480): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(493): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(503): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(531): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(542): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(574): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
C:\Users\User\Desktop\my-project\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call'
..\src\serialport_win.cpp(590): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(592): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(921): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
C:\Users\User\Desktop\my-project\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call'
..\src\serialport_win.cpp(935): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(944): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
LINK : fatal error LNK1104: cannot open file 'libcpmt.lib' [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.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:\Users\User\Desktop\my-project\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:239:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\User\\Desktop\\my-project\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--target=2.0.7" "--arch=x64" "--dist-url=https://atom.io/download/electron" "--build-from-source"
gyp ERR! cwd C:\Users\User\Desktop\my-project\node_modules\serialport
gyp ERR! node -v v10.9.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Failed with exit code: 1
Error: Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
serialport.cpp
serialport_win.cpp
win_delay_load_hook.cc
..\src\serialport.cpp(95): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
C:\Users\User\Desktop\my-project\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call'
..\src\serialport.cpp(150): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
C:\Users\User\Desktop\my-project\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call'
..\src\serialport.cpp(188): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
C:\Users\User\Desktop\my-project\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call'
..\src\serialport.cpp(231): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
C:\Users\User\Desktop\my-project\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call'
..\src\serialport.cpp(285): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
C:\Users\User\Desktop\my-project\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call'
..\src\serialport.cpp(336): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
C:\Users\User\Desktop\my-project\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call'
..\src\serialport.cpp(383): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
C:\Users\User\Desktop\my-project\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call'
..\src\serialport.cpp(424): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
C:\Users\User\Desktop\my-project\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call'
..\src\serialport_win.cpp(188): warning C4311: 'type cast': pointer truncation from 'HANDLE' to 'int' [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(188): warning C4302: 'type cast': truncation from 'HANDLE' to 'int' [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(198): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(205): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(215): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(217): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(221): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(223): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(227): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(229): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(234): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(246): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(256): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(273): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(334): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(360): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(390): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
C:\Users\User\Desktop\my-project\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call'
..\src\serialport_win.cpp(463): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(480): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(493): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(503): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(531): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(542): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(574): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
C:\Users\User\Desktop\my-project\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call'
..\src\serialport_win.cpp(590): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(592): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(921): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
C:\Users\User\Desktop\my-project\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call'
..\src\serialport_win.cpp(935): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
..\src\serialport_win.cpp(944): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.vcxproj]
LINK : fatal error LNK1104: cannot open file 'libcpmt.lib' [C:\Users\User\Desktop\my-project\node_modules\serialport\build\serialport.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:\Users\User\Desktop\my-project\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:239:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\User\\Desktop\\my-project\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--target=2.0.7" "--arch=x64" "--dist-url=https://atom.io/download/electron" "--build-from-source"
gyp ERR! cwd C:\Users\User\Desktop\my-project\node_modules\serialport
gyp ERR! node -v v10.9.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Failed with exit code: 1
at SafeSubscriber._error (C:\Users\User\Desktop\my-project\node_modules\spawn-rx\lib\src\index.js:277:84)
at SafeSubscriber.__tryOrUnsub (C:\Users\User\Desktop\my-project\node_modules\spawn-rx\node_modules\rxjs\Subscriber.js:242:16)
at SafeSubscriber.error (C:\Users\User\Desktop\my-project\node_modules\spawn-rx\node_modules\rxjs\Subscriber.js:201:26)
at Subscriber._error (C:\Users\User\Desktop\my-project\node_modules\spawn-rx\node_modules\rxjs\Subscriber.js:132:26)
at Subscriber.error (C:\Users\User\Desktop\my-project\node_modules\spawn-rx\node_modules\rxjs\Subscriber.js:106:18)
at MapSubscriber.Subscriber._error (C:\Users\User\Desktop\my-project\node_modules\spawn-rx\node_modules\rxjs\Subscriber.js:132:26)
at MapSubscriber.Subscriber.error (C:\Users\User\Desktop\my-project\node_modules\spawn-rx\node_modules\rxjs\Subscriber.js:106:18)
at SafeSubscriber._next (C:\Users\User\Desktop\my-project\node_modules\spawn-rx\lib\src\index.js:251:65)
at SafeSubscriber.__tryOrSetError (C:\Users\User\Desktop\my-project\node_modules\spawn-rx\node_modules\rxjs\Subscriber.js:251:16)
at SafeSubscriber.next (C:\Users\User\Desktop\my-project\node_modules\spawn-rx\node_modules\rxjs\Subscriber.js:191:27)
npm ERR! code ELIFECYCLE
npm ERR! errno 4294967295
npm ERR! [email protected] install: `electron-rebuild`
npm ERR! Exit status 4294967295
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
I do have the same issue, it seems that a release package is not available for 6.2.2-electron-windows-64 bit, although it is available for 6.2.1
I had to revert to 6.2.1 for my build to work again
@MatxBerg You are a life savior!!!!!
Thanks thanks thanks!!!
I can't believe I lost so many hours to this...
I guess I learned something today: "Always try old builds" haha
We should have all the builds back for the next version. You can build it yourself but that's a different approach and windows doesn't make it easy.
Most helpful comment
I do have the same issue, it seems that a release package is not available for 6.2.2-electron-windows-64 bit, although it is available for 6.2.1
I had to revert to 6.2.1 for my build to work again