Error compiling: i2c.cc fatal error!


#1

I am trying to build OpenROV on Win10. I have VS2017 installed. I have the latest node.js and npm. When I execute npm install for a development build, I get the following

npm install i2c
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but npm-shrinkwrap.json was generated for lockfileVersion@0. I’ll try to do my best with it!
npm WARN prefer global coffee-script@1.9.1 should be installed with -g

i2c@0.2.3 install C:\Users\neil\openrov-cockpit\node_modules\i2c
node-gyp rebuild

C:\Users\neil\openrov-cockpit\node_modules\i2c>if not defined npm_config_node_gyp (node “C:\Users\neil\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\…\node_modules\node-gyp\bin\node-gyp.js” rebuild ) else (node “” rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the “/m” switch.
i2c.cc
win_delay_load_hook.cc
…\src\i2c.cc(7): fatal error C1083: Cannot open include file: ‘sys/ioctl.h’: No such file or directory [C:\Users\neil
openrov-cockpit\node_modules\i2c\build\i2c.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\neil\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:258:23)
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 10.0.14393
gyp ERR! command “C:\Program Files\nodejs\node.exe” “C:\Users\neil\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js” "rebuild"
gyp ERR! cwd C:\Users\neil\openrov-cockpit\node_modules\i2c
gyp ERR! node -v v6.11.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN OpenROV-Cockpit@31.0.0 No license field.
npm WARN The package request is included as both a dev and production dependency.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! i2c@0.2.3 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the i2c@0.2.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\neil\AppData\Roaming\npm-cache_logs\2017-06-27T06_11_58_832Z-debug.log

I have sys/ioctl.h installed as it is part of VS and it is in the standard directory. Obviously something is “off” here. Can anyone provide any guidance? Thanks


#2

I had the same error in Jan 2017 and never got a solution in this forum topic:

I gave up and used the writeup by Bob_Ellis for installing Cockpit on a RPi3 -

The entry “How to run openrov on a naked raspberry pi” around May 26 is the good step by step.

Let us know if you find a solution on Win10.


#3

Well, I did get further. I noticed that the failure seemed to be around node-gyp, so I looked up node-gyp and did a complete install of node-gyp on Windows as described on its GitHub page

This detailed the manner in which a compatible Windows environment could be installed along with the appropriate python (2.7).

This took me further but I still have a problem in the installation steps where something is “undefined” for some reason:

npm install
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but npm-shrinkwrap.json was generated for lockfileVersion@0. I’ll try to do my best with it!
npm WARN deprecated bower@1.7.9: …psst! While Bower is maintained, we recommend Yarn and Webpack for new front-end projects! Yarn’s advantage is security and reliability, and Webpack’s is support for both CommonJS and AMD projects. Currently there’s no migration path but we hope you’ll help us figure out one.
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated node-uuid@1.4.7: Use uuid module instead

serialport@5.0.0-beta1 install C:\Users\neil\openrov-cockpit\node_modules\serialport
node-pre-gyp install --fallback-to-build

node-pre-gyp info it worked if it ends with ok
node-pre-gyp verb cli [ ‘C:\Program Files\nodejs\node.exe’,
node-pre-gyp verb cli ‘C:\Users\neil\openrov-cockpit\node_modules\serialport\node_modules\node-pre-gyp\bin\node-pre-gyp’,
node-pre-gyp verb cli ‘install’,
node-pre-gyp verb cli ‘–fallback-to-build’ ]
node-pre-gyp info using node-pre-gyp@0.6.30
node-pre-gyp info using node@6.11.0 | win32 | x64
node-pre-gyp verb command install []
node-pre-gyp info check checked for “C:\Users\neil\openrov-cockpit\node_modules\serialport\build\Release\serialport.node” (not found)
node-pre-gyp http GET https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/5.0.0-beta1/serialport-v5.0.0-beta1-node-v48-win32-x64.tar.gz
node-pre-gyp http 200 https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/5.0.0-beta1/serialport-v5.0.0-beta1-node-v48-win32-x64.tar.gz
node-pre-gyp info install unpacking obj/
node-pre-gyp info install unpacking obj/serialport/
node-pre-gyp info install unpacking obj/serialport/disphelper.obj
node-pre-gyp info install unpacking obj/serialport/enumser.obj
node-pre-gyp info install unpacking obj/serialport/serialport.obj
node-pre-gyp info install unpacking obj/serialport/serialport.tlog/
node-pre-gyp info install unpacking obj/serialport/serialport.tlog/CL.read.1.tlog
node-pre-gyp info install unpacking obj/serialport/serialport.tlog/cl.command.1.tlog
node-pre-gyp info install unpacking obj/serialport/serialport.tlog/cl.write.1.tlog
node-pre-gyp info install unpacking obj/serialport/serialport.tlog/link.command.1.tlog
node-pre-gyp info install unpacking obj/serialport/serialport.tlog/link.read.1.tlog
node-pre-gyp info install unpacking obj/serialport/serialport.tlog/link.write.1.tlog
node-pre-gyp info install unpacking obj/serialport/serialport.tlog/serialport.lastbuildstate
node-pre-gyp info install unpacking obj/serialport/serialport.tlog/serialport.write.1u.tlog
node-pre-gyp info install unpacking obj/serialport/serialport_win.obj
node-pre-gyp info install unpacking obj/serialport/vc120.pdb
node-pre-gyp info install unpacking obj/serialport/win_delay_load_hook.obj
node-pre-gyp info install unpacking serialport.exp
node-pre-gyp info install unpacking serialport.lib
node-pre-gyp info install unpacking serialport.map
node-pre-gyp info install unpacking serialport.node
node-pre-gyp info install unpacking serialport.pdb
node-pre-gyp info tarball done parsing tarball
node-pre-gyp info validate Running test command: ‘C:\Program Files\nodejs\node.exe --eval ‘require(‘C:/Users/neil/openrov-cockpit/node_modules/serialport/build/Release/serialport.node’)’’
[serialport] Success: “C:\Users\neil\openrov-cockpit\node_modules\serialport\build\Release\serialport.node” is installed via remote
node-pre-gyp info ok

fibers@1.0.15 install C:\Users\neil\openrov-cockpit\node_modules\fibers
node build.js || nodejs build.js

win32-x64-48 exists; testing
Binary is fine; exiting

OpenROV-Cockpit@31.0.0 install C:\Users\neil\openrov-cockpit
node install_lib/bower_install_all.js && node install_lib/npm_install_all.js

Ingnoring C:\Users\neil\openrov-cockpit.git
Ingnoring C:\Users\neil\openrov-cockpit\node_modules
Execute bower install on C:\Users\neil\openrov-cockpit\webcomponent_docs\bower.json
Execute bower install on C:\Users\neil\openrov-cockpit\src\static\bower.json
Execute bower install on C:\Users\neil\openrov-cockpit\src\beta-plugins\classic-ui\public\bower.json
Execute bower install on C:\Users\neil\openrov-cockpit\src\beta-plugins\headsup-menu\public\bower.json
Execute bower install on C:\Users\neil\openrov-cockpit\src\beta-plugins\gps\public\bower.json
Execute bower install on C:\Users\neil\openrov-cockpit\src\beta-plugins\internet-control\public\bower.json
Execute bower install on C:\Users\neil\openrov-cockpit\src\beta-plugins\videofilter-edge-threejs\public\bower.json
Execute bower install on C:\Users\neil\openrov-cockpit\src\plugins\blackbox\public\bower.json
Execute bower install on C:\Users\neil\openrov-cockpit\src\plugins\geomuxp\public\bower.json
Execute bower install on C:\Users\neil\openrov-cockpit\src\plugins\internet-stream\public\bower.json
Execute bower install on C:\Users\neil\openrov-cockpit\src\plugins\input-configurator\public\bower.json
Execute bower install on C:\Users\neil\openrov-cockpit\src\plugins\mobile-ui\public\bower.json
Execute bower install on C:\Users\neil\openrov-cockpit\src\plugins\new-ui\public\bower.json
Execute bower install on C:\Users\neil\openrov-cockpit\src\plugins\peer-view\public\bower.json
Execute bower install on C:\Users\neil\openrov-cockpit\src\plugins\telemetry\public\bower.json
Execute bower install on C:\Users\neil\openrov-cockpit\src\plugins\thrusters2x1\public\bower.json
Execute bower install on C:\Users\neil\openrov-cockpit\src\plugins\video\public\bower.json
Execute bower install on C:\Users\neil\openrov-cockpit\src\static\webcomponents\orov-behaviors\bower.json
Execute bower install on C:\Users\neil\openrov-cockpit\src\system-plugins\cloud-profile\public\bower.json
Execute bower install on C:\Users\neil\openrov-cockpit\src\system-plugins\input-controller\public\bower.json
Execute bower install on C:\Users\neil\openrov-cockpit\src\system-plugins\settings-manager\public\bower.json
Execute bower install on C:\Users\neil\openrov-cockpit\src\system-plugins\software-update-alert\public\bower.json
Execute bower install on C:\Users\neil\openrov-cockpit\src\system-plugins\ui-manager\public\bower.json
======== cleaning =======
C:\Users\neil\openrov-cockpit\src\static/bower_components
======== installing =======
C:\Users\neil\openrov-cockpit\src\static
undefined

…stuff deleted…

font-roboto#1.0.1
iron-localstorage#1.0.6
paper-dialog-scrollable#1.1.5
fpsmeter#0.3.1
jquery-ui#1.12.1
eventemitter2#1.0.0
i18next#1.11.5
paper-dialog-behavior#1.2.8
iron-flex-layout#1.3.7
paper-styles#1.3.1
webcomponentsjs#0.7.24
polymer#1.9.2
iron-overlay-behavior#1.10.4
iron-fit-behavior#1.2.6
iron-a11y-keys-behavior#1.1.9
iron-resizable-behavior#1.0.6
jquery#3.1.1
done processing plugin install
======== cleaning =======
/bower_components
======== installing =======

undefined
No bower.json present
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! OpenROV-Cockpit@31.0.0 install: node install_lib/bower_install_all.js && node install_lib/npm_install_all.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the OpenROV-Cockpit@31.0.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\neil\AppData\Roaming\npm-cache_logs\2017-06-27T16_32_31_275Z-debug.log


#4

Does anyone have Cockpit for development running on Windows (Win10)?

I noticed in Discord chat #github that the i2c was moved to optionalDependencies in .\openrov-cockpit\package.json so I tried again by following the instructions for Windows in openrov-cockpit\docs\DEV-HOWTO. This time it continued past the i2c ERR ( without me doing the complete install of node-gyp per @neil2 ), but it generated the same ERR that @neil2 got above.

What to do?