Have you tried the following commands?
This is after the sudu npm command you sugested
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.8 (node_modules/particle-cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.8: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
npm ERR! path /usr/local/lib/node_modules/particle-cli/dist/index.js
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod ‘/usr/local/lib/node_modules/particle-cli/dist/index.js’
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /home/les/.npm/_logs/2019-05-20T01_01_38_067Z-debug.log
les@les-RV411-RV511-E3511-S3511:~$ particle login
bash: /usr/local/bin/particle: No such file or directory
What do you get for node -v
and npm -v
?
v8.10.0
&
6.9.0
I’m getting a different issue on 18.04.1 but it still runs fine.
$ sudo npm install -g --unsafe-perm particle-cli
/usr/bin/particle -> /usr/lib/node_modules/particle-cli/dist/index.js
> usb@https://github.com/particle-iot/node-usb/archive/particle-1.5.0.tar.gz install /usr/lib/node_modules/particle-cli/node_modules/usb
> prebuild-install --tag-prefix particle- --verbose || node-gyp rebuild
prebuild-install info begin Prebuild-install version 5.2.5
prebuild-install info looking for cached prebuild @ /home/nrobinson/.npm/_prebuilds/33374e-usb-v1.5.0-node-v59-linux-x64.tar.gz
prebuild-install http request GET https://github.com/particle-iot/node-usb/releases/download/particle-1.5.0/usb-v1.5.0-node-v59-linux-x64.tar.gz
prebuild-install http 404 https://github.com/particle-iot/node-usb/releases/download/particle-1.5.0/usb-v1.5.0-node-v59-linux-x64.tar.gz
prebuild-install WARN install No prebuilt binaries found (target=9.11.2 runtime=node arch=x64 libc= platform=linux)
make: Entering directory '/usr/lib/node_modules/particle-cli/node_modules/usb/build'
make: *** No rule to make target 'Release/obj.target/libusb/libusb/libusb/core.o', needed by 'Release/obj.target/usb.a'. Stop.
make: Leaving directory '/usr/lib/node_modules/particle-cli/node_modules/usb/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:180:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
gyp ERR! System Linux 4.15.0-46-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/lib/node_modules/particle-cli/node_modules/usb
gyp ERR! node -v v9.11.2
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.8 (node_modules/particle-cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.8: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: usb@1.5.0 (node_modules/particle-cli/node_modules/usb):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: usb@https://github.com/particle-iot/node-usb/archive/particle-1.5.0.tar.gz install: `prebuild-install --tag-prefix particle- --verbose || node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
+ particle-cli@1.41.0
updated 1 package in 5.694s
For your problem it sounds like it’s complaining about the following file:
/usr/local/lib/node_modules/particle-cli/dist/index.js
Could you see whether it exists or not, and possibly chmod +x
it?
Sorry for the delay.
This seems to fix it for me:
sudo apt install libusb-dev
sudo npm install -g --unsafe-perm particle-cli
Is there an uninstall po
command, or something that will do that?
It installed like GB’s worth of files into folder .po-utils , that are not needed to solve this issue. I guess I can delete that folder, but I would also like to purge the po and /usr/local/bin/ and share/ and whatever else. Is that all that’s needed? Thanks
$ curl -fsSLO https://github.com/nrobinson2000/po/raw/master/depend/60-po-util.rules
$ sudo mv 60-po-util.rules /etc/udev/rules.d/60-po-util.rules
Using these two lines to put this rules file in the udev/rules.d folder and then restarting worked great for me. (for what it’s worth, the particle serial identify
command from the VS CLI would work if I put sudo
in front, so I didn’t have any other issues)
Hey @leka0024,
Since this post, I’ve completely reimplemeted po-util in Python and created neopo, a far superior tool.
I would highly recommend switching to neopo. Let me know if you have any questions.
Regarding your question, you can also install the udev rules file with:
particle usb configure
How do I purge the “old” po? It installed easily enough with po install
, so is there an automated uninstall? Or do I just need to delete the three folders from the curl lines and the .po-utils folder, and figure out how to remove the po command? Thanks!
On Linux, deleting the following files and directory should be sufficient:
/usr/local/bin/po
/usr/local/bin/po-common
/usr/local/bin/po-linux
/usr/local/share/man/man1/po
/etc/bash_completion.d/po
~/.po-util
I apologize for your stumbling upon of po-util as it’s terribly unorganized. I will add more deprecation notices to the script.