synthetos / node-g2core-api

NodeJS host communications, API and command line interface for g2 CNC system
GNU General Public License v2.0
8 stars 6 forks source link

Failure to build MacOS 11.5 #14

Open kyselad opened 2 years ago

kyselad commented 2 years ago

Not sure if this is the same dependency bug listed in another issue, but npm fails to install node-g2core-api on my Mac. Errors seem to revolve around serialport. Any ideas whether this is an issue with the package or particular to my machine and/or how I'm installing? npm execute as superuser for what it's worth.

/usr/local/bin/g2-> /usr/local/lib/node_modules/g2core-api/bin/g2.js /usr/local/bin/g2_log_analysis -> /usr/local/lib/node_modules/g2core-api/bin/g2_log_analysis.js serialport@4.0.7 install /usr/local/lib/node_modules/g2core-api/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 [ node-pre-gyp verb cli '/usr/local/bin/node', node-pre-gyp verb cli '/usr/local/lib/node_modules/g2core-api/node_modules/serialport/node_modules/.bin/node-pre-gyp', node-pre-gyp verb cli 'install', node-pre-gyp verb cli '--fallback-to-build' node-pre-gyp verb cli ] node-pre-gyp info using node-pre-gyp@0.6.32 node-pre-gyp info using node@14.17.5 | darwin | x64 node-pre-gyp verb command install [] node-pre-gyp info check checked for "/usr/local/lib/node_modules/g2core-api/node_modules/serialport/build/Release/serialport.node" (not found) node-pre-gyp http GET https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/4.0.7/serialport-v4.0.7-node-v83-darwin-x64.tar.gz node-pre-gyp ERR! Tried to download(undefined): https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/4.0.7/serialport-v4.0.7-node-v83-darwin-x64.tar.gz node-pre-gyp ERR! Pre-built binaries not found for serialport@4.0.7 and node@14.17.5 (node-v83 ABI) (falling back to source compile with node-gyp) node-pre-gyp http EACCES: permission denied, mkdir '/usr/local/lib/node_modules/g2core-api/node_modules/serialport/build' node-pre-gyp verb command build [ 'rebuild' ] gyp WARN EACCES current user ("nobody") does not have permission to access the dev dir "/Users/dtk6/Library/Caches/node-gyp/14.17.5" gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/g2core-api/node_modules/serialport/.node-gyp" gyp WARN install got an error, rolling back install gyp WARN install got an error, rolling back install gyp ERR! configure error gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/g2core-api/node_modules/serialport/.node-gyp' gyp ERR! System Darwin 20.6.0 gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/usr/local/lib/node_modules/g2core-api/node_modules/serialport/build/Release/serialport.node" "--module_name=serialport" "--module_path=/usr/local/lib/node_modules/g2core-api/node_modules/serialport/build/Release" gyp ERR! cwd /usr/local/lib/node_modules/g2core-api/node_modules/serialport gyp ERR! node -v v14.17.5 gyp ERR! node-gyp -v v5.1.0 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/g2core-api/node_modules/serialport/build/Release/serialport.node --module_name=serialport --module_path=/usr/local/lib/node_modules/g2core-api/node_modules/serialport/build/Release' (1) node-pre-gyp ERR! stack at ChildProcess. (/usr/local/lib/node_modules/g2core-api/node_modules/serialport/node_modules/node-pre-gyp/lib/util/compile.js:83:29) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:400:28) node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1055:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5) node-pre-gyp ERR! System Darwin 20.6.0 node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/g2core-api/node_modules/serialport/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd /usr/local/lib/node_modules/g2core-api/node_modules/serialport node-pre-gyp ERR! node -v v14.17.5 node-pre-gyp ERR! node-pre-gyp -v v0.6.32 node-pre-gyp ERR! not ok Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/g2core-api/node_modules/serialport/build/Release/serialport.node --module_name=serialport --module_path=/usr/local/lib/node_modules/g2core-api/node_modules/serialport/build/Release' (1) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! serialport@4.0.7 install: node-pre-gyp install --fallback-to-build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the serialport@4.0.7 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! /Users/dtk6/.npm/_logs/2021-08-20T20_59_50_449Z-debug.log

kyselad commented 2 years ago

Just to update, I used the node n utility to downgrade the node version to 6.15.1, since an earlier issue mentioned serialport compatibility only through 6.x. After the node downgrade, installation of g2core-api using npm now works fine. So it seems this issue will remain until the serialport discrepancy is resolved. Perhaps best to merge with the earlier issue?