OpenZWave / node-openzwave-shared

OpenZWave addon for Node.js (all versions) including management and security functions
Other
199 stars 113 forks source link

Install fails #322

Closed milosjovac closed 5 years ago

milosjovac commented 5 years ago

Hi,

I have some installation troubles since few days ago. Device is RockPro64 - ARMBIAN 5.75 stable Debian GNU/Linux 9 (stretch) 4.4.182-rockchip64.

In Dockerfile (Node.js v11.15.0) RUN npm install openzwave-shared and directly on the device without Docker (Node.js v10.16.0, npm v6.9.0) npm install openzwave-shared --unsafe-perm it fails with a following error:

sysadmin@rockpro64:/opt/myproj$ sudo npm install openzwave-shared --unsafe-perm

> openzwave-shared@1.5.3 preinstall /opt/myproj/node_modules/openzwave-shared
> node lib/install-ozw.js
> openzwave-shared@1.5.3 install /opt/myproj/node_modules/openzwave-shared
> node-gyp rebuild

grep: /usr/*/includevalue_classes: No such file or directory
gyp: Call to 'grep -r GetTypeNameFromEnum /usr/*/includevalue_classes | wc -l' returned exit status 0 while in binding.gyp. 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 (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:345:16)
gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 4.4.182-rockchip64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /opt/myproj/node_modules/openzwave-shared
gyp ERR! node -v v10.16.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! openzwave-shared@1.5.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the openzwave-shared@1.5.3 install script.

I have noticed that people have been reporting installation troubles lately (and some people are trying to fix it), but I couldn't make it work based on the hints from other issues. I hope this logs can help, and if I can send any other data please let me know.

ekarak commented 5 years ago

Just published 1.5.4, please retest

milosjovac commented 5 years ago

I still get the same error message in both cases

milosjovac commented 5 years ago

With --verbose flag

gyp verb get node dir target node version installed: 12.5.0
gyp verb build dir attempting to create "build" dir: /node_modules/openzwave-shared/build
gyp verb build dir "build" dir needed to be created? /node_modules/openzwave-shared/build
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: /node_modules/openzwave-shared/build/config.gypi
gyp verb config.gypi checking for gypi file: /node_modules/openzwave-shared/config.gypi
gyp verb common.gypi checking for gypi file: /node_modules/openzwave-shared/common.gypi
gyp verb gyp gyp format was not specified; forcing "make"
gyp info spawn /usr/bin/python2
gyp info spawn args [
gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/node_modules/openzwave-shared/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/root/.node-gyp/12.5.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/root/.node-gyp/12.5.0',
gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/root/.node-gyp/12.5.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/node_modules/openzwave-shared',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
grep: /usr/include/openzwavevalue_classes: No such file or directory
gyp: Call to 'grep -r GetTypeNameFromEnum /usr/include/openzwavevalue_classes | wc -l' returned exit status 0 while in binding.gyp. 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 (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:345:16)
gyp ERR! stack     at ChildProcess.emit (events.js:200:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Linux 4.4.182-rockchip64
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /node_modules/openzwave-shared
gyp ERR! node -v v12.5.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm verb lifecycle openzwave-shared@1.5.4~install: unsafe-perm in lifecycle false
npm verb lifecycle openzwave-shared@1.5.4~install: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/node_modules/openzwave-shared/node_modules/.bin:/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
npm verb lifecycle openzwave-shared@1.5.4~install: CWD: /node_modules/openzwave-shared
npm info lifecycle openzwave-shared@1.5.4~install: Failed to exec install script
npm timing action:install Completed in 5627ms
npm verb unlock done using /root/.npm/_locks/staging-781faa38490e6896.lock for /node_modules/.staging
npm timing stage:rollbackFailedOptional Completed in 48ms
npm timing stage:runTopLevelLifecycles Completed in 12187ms
npm WARN enoent ENOENT: no such file or directory, open '/package.json'
npm verb enoent This is related to npm not being able to find a file.
npm verb enoent 
npm WARN !invalid#1 No description
npm WARN !invalid#1 No repository field.
npm WARN !invalid#1 No README data
npm WARN !invalid#1 No license field.

npm verb stack Error: openzwave-shared@1.5.4 install: `node-gyp rebuild`
npm verb stack Exit status 1
npm verb stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
npm verb stack     at EventEmitter.emit (events.js:200:13)
npm verb stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
npm verb stack     at ChildProcess.emit (events.js:200:13)
npm verb stack     at maybeClose (internal/child_process.js:1021:16)
npm verb stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
npm verb pkgid openzwave-shared@1.5.4
npm verb cwd /
npm verb Linux 4.4.182-rockchip64
npm verb argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "openzwave-shared@1.5.4" "--verbose"
npm verb node v12.5.0
npm verb npm  v6.9.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! openzwave-shared@1.5.4 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the openzwave-shared@1.5.4 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm verb exit [ 1, true ]
npm timing npm Completed in 13133ms

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-07-02T12_13_58_291Z-debug.log
thucar commented 5 years ago

I'm stuck with this as well.

grep: /usr/*/includevalue_classes: No such file or directory

It would seem we are missing a forward slash between 'include' and 'value_classes'

milosjovac commented 5 years ago

@thucar includevalue_classes: No such file or directory errors happened to me when open-zwave was not installed. openzwavevalue_classes : No such file or directory on the other hand is a build problem.

thucar commented 5 years ago

Which also seems to be missing a forward slash.

grep: /usr/local/include/openzwavevalue_classes: No such file or directory
gyp: Call to 'grep -r GetTypeNameFromEnum /usr/local/include/openzwavevalue_classes | wc -l' returned exit status 0 while in binding.gyp. while trying to load binding.gyp

The odd thing is, I have two hardware-identical machines running 95% similar setup. On the first machine I had no issues upgrading to the latest openzwave-shared. On the other machine this pops up.

thucar commented 5 years ago

Going back step by step I determined that the most recent version that does not cause this error, is version 1.5.2

milosjovac commented 5 years ago

What is your NodeJS and node-gyp version?

uuperi commented 3 years ago

for me the problem was that I had not installed libopenzwave1.5-dev