Po-util always downloads the most latest version of node due to its futureproofing features. It makes sense that serialport would not be working. Should I change Po-util so that it installs the second or third latest version of node so that serialport would be caught up?
Installing the CLI doesn’t need a compiler, but in some cases it seems the node package manager (npm) can’t figure out which pre-compiled version of serialport to use so it falls back to trying to compile it. So in those cases having a compiler will allow installation to proceed but it shouldn’t fall back to compiling in the first place.
Hey I'm running Sierra 10.12.6
I've spent the last couple of days trying to figure out issues with serialport mismatch and trying various ways to get the particle CLI up and running, to no avail.
Here is a compiled list of references that I seemed to circle back to:
I am having a similar issue as a lot of people and getting hung up on weird dependency/permission/PATH/mismatch issues. So to retry everything again I decided to install po-util in hopes that it would build everything as needed and I could finally finish up some projects. Here are my steps and the resulting error. It seems like I'm really close to fixing this.
After installing I got this output (this is the same output I just reran it because I didn't grab the error the first time)
Davids-MacBook-Pro:~ daviddefilippis$ po install
Installing Particle firmware from Github...
fatal: destination path 'firmware' already exists and is not an empty directory.
Installing RedBear Duo firmware from Github...
fatal: destination path 'firmware' already exists and is not an empty directory.
Installing ARM toolchain...
Already up-to-date.
Warning: nrobinson2000/po/gcc-arm-none-eabi-53 20160330 is already installed
Warning: dfu-util 0.9 is already installed
[serialport] Success: "/usr/local/lib/node_modules/serialport/build/Release/serialport.node" is installed via remote
node-pre-gyp@0.6.38
npm@5.4.2
particle-cli@1.24.1
serialport@5.0.0
updated 4 packages in 26.882s
Thank you for installing po-util. Be sure to check out https://po-util.com
if you have any questions, suggestions, comments, or problems. You can use
the message button in the bottom right corner of the site to send me a
message. If you need to update po-util just run "po update" to download
the latest versions of po-util, Particle Firmware and particle-cli, or run
"po install" to update all dependencies.
Error: Cannot find module 'xtend'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/usr/local/lib/node_modules/particle-cli/settings.js:31:14)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
Davids-MacBook-Pro:~ daviddefilippis$
New error but can you
a) point me in the right direction to chase this error down
b) help point me to a resource that will wipe node and po-util and all dependencies so that I can start fresh
node-pre-gyp info it worked if it ends with ok
node-pre-gyp verb cli [ '/usr/local/bin/node',
node-pre-gyp verb cli '/usr/local/lib/node_modules/particle-cli/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 info using node-pre-gyp@0.6.32
node-pre-gyp info using node@6.9.1 | darwin | x64
node-pre-gyp verb command install
node-pre-gyp info check checked for "/usr/local/lib/node_modules/particle-cli/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-v48-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-v48-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for serialport@4.0.7 and node@6.9.1 (node-v48 ABI) (falling back to source compile with node-gyp)
node-pre-gyp http EACCES: permission denied, mkdir '/usr/local/lib/node_modules/particle-cli/node_modules/serialport/build'
node-pre-gyp verb command build [ 'rebuild' ]
node-pre-gyp http 200 https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/4.0.7/serialport-v4.0.7-node-v48-darwin-x64.tar.gz
gyp WARN EACCES user "root" does not have permission to access the dev dir "/Users/daviddefilippis/.node-gyp/6.9.1"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/particle-cli/node_modules/serialport/.node-gyp"
gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/local/lib/node_modules/particle-cli/node_modules/serialport/.node-gyp/6.9.1"
and the reinstall attempt, permissions error loop goes on forever.
Checking the permissions for either of the directories that are throwing the error yeilds
Davids-MacBook-Pro:~ daviddefilippis$ ls -l /usr/local/lib/node_modules/particle-cli/node_modules/serialport/.node-gyp/6.9.1
ls: /usr/local/lib/node_modules/particle-cli/node_modules/serialport/.node-gyp/6.9.1: No such file or directory
Davids-MacBook-Pro:~ daviddefilippis$ ls -l /usr/local/lib/node_modules/particle-cli/node_modules/serialport/.node-gyp
ls: /usr/local/lib/node_modules/particle-cli/node_modules/serialport/.node-gyp: No such file or directory
Davids-MacBook-Pro:~ daviddefilippis$
I was thinking I could edit the permissions but the directories don't exist (I'm thinking a failed install rolls back)
This issue seems like it is rooted in compatibility problems with serialport
again, thanks for all the help
ls -l /usr/local/lib/node_modules/particle-cli/node_modules/serialport/.node-gyp/6.9.1
ls -l /usr/local/lib/node_modules/particle-cli/node_modules/serialport/.node-gyp
For giggles I cpj’d [quote=“kennethlimcp, post:34, topic:24191”]
sudo npm install -g particle-cli
[/quote]
Cool, thanks for the heads up. How does this output look to you (or compared to your tests)?
I just threw in the po install command to see what happened and get the versions of some of the more important packages
Davids-MacBook-Pro:~ daviddefilippis$ po install
Installing Particle firmware from Github...
fatal: destination path 'firmware' already exists and is not an empty directory.
Installing RedBear Duo firmware from Github...
fatal: destination path 'firmware' already exists and is not an empty directory.
[serialport] Success: "/usr/local/lib/node_modules/serialport/build/Release/serialport.node" is installed via remote
node-pre-gyp@0.6.38
serialport@5.0.0
npm@5.4.2
particle-cli@1.24.1
updated 4 packages in 20.871s
Thank you for installing po-util. Be sure to check out https://po-util.com
if you have any questions, suggestions, comments, or problems. You can use
the message button in the bottom right corner of the site to send me a
message. If you need to update po-util just run "po update" to download
the latest versions of po-util, Particle Firmware and particle-cli, or run
"po install" to update all dependencies.
after the po install command there is an output line that reads:
Trying to interact with the particle cli yeilds:
Davids-MacBook-Pro:~ daviddefilippis$ particle login
! Error loading module 'serialport': Could not locate the bindings file. Tried:
→ /usr/local/lib/node_modules/particle-cli/node_modules/serialport/build/serialport.node
→ /usr/local/lib/node_modules/particle-cli/node_modules/serialport/build/Debug/serialport.node
→ /usr/local/lib/node_modules/particle-cli/node_modules/serialport/build/Release/serialport.node
→ /usr/local/lib/node_modules/particle-cli/node_modules/serialport/out/Debug/serialport.node
→ /usr/local/lib/node_modules/particle-cli/node_modules/serialport/Debug/serialport.node
→ /usr/local/lib/node_modules/particle-cli/node_modules/serialport/out/Release/serialport.node
→ /usr/local/lib/node_modules/particle-cli/node_modules/serialport/Release/serialport.node
→ /usr/local/lib/node_modules/particle-cli/node_modules/serialport/build/default/serialport.node
→ /usr/local/lib/node_modules/particle-cli/node_modules/serialport/compiled/6.9.1/darwin/x64/serialport.node
Please reinstall the CLI again using npm install -g particle-cli
Davids-MacBook-Pro:~ daviddefilippis$
The 3rd line in the error output is:
! Error loading module 'serialport': Could not locate the bindings file. Tried:
→ /usr/local/lib/node_modules/particle-cli/node_modules/serialport/build/Release/serialport.node
and po install output was:
Success: "/usr/local/lib/node_modules/serialport/build/Release/serialport.node" is installed via remote
Should I move files around or try and link directories?