@nayelyz I have used the CLI without issue in the past. Recently, I have been trying to set it up on another RPi, but it will not run. Specifically, after using npm to install @smartthings/cli, I receive the following error when typing “smartthings”:
TypeError: HelpClass is not a constructor
If I execute “run” directly, I receive this error:
line 3: syntax error near unexpected token
'@oclif/command'' line 3: require(’@oclif/command’).run()’
If you use the command
smartthings --version, do you receive the same error?
Have you tried downloading the release here directly? There’s a file for Linux if the RPi is using that OS
In the meantime, I will check if I also have issues using the npm installation.
smartthings --version returns the following:
@smartthings/cli/0.0.0-pre.34 linux-arm node-v16.13.2
Every other command that I’ve tried returns the TypeError.
I’ll try your link.
This particular RPi is running RaspberryPi OS 32 bit. When I try to execute the smartthings binary that you linked to, I receive the following error:
“cannot execute binary file”
I can’t tell what kind of system that binary was compiled for: armhf, amd64, etc.?
You don’t have to execute it, you only need to make reference to it and add the corresponding command. For example:
This should open a web browser page for the authorization but you can also use a PAT
I believe that is just a different way of executing the binary, but regardless, it results in this:
cannot execute binary file: Exec format error
Ok, I will check more details with the engineering team.
@Delgreco007, the team mentioned the failure of the commands is expected because it is not currently built for ARM.
However, the CLI support on this OS is already considered by the team for the future.
Correct. I have run prior versions of the CLI on both RaspberryPi OS 32 bit and 64 bit. I receive the same error when trying to install with npm on both at present. Unfortunately, I do not remember the prior version numbers, although I do know I was able to interface with edge devices, so it would have been some more recent versions.
@TAustin Have you encountered this? I believe I’ve read somewhere on here that you also frequently use a RPi?
I am running CLI version:
@smartthings/cli/0.0.0-pre.34 linux-arm node-v15.14.0
I install with this command:
npm i -g @smartthings/cli
and have not had any problems on my RPI 4b with Raspberry Pi OS 10 (buster)
Have you tried installing from scratch any time recently? I was able to upgrade previously without a problem. This only cropped up on a new installation of buster.
I upgraded about a week ago, not an install from scratch. I’ve hear about problems with bullseye, but not so much with buster. I’m running 10.9
For anyone else that encounters this problem (smartthings/cli 0.0.0-pre.34), I was able to get a working version by cloning the smartthings/core-sdk and the smartthings/cli and following the directions here:
GitHub - SmartThingsCommunity/smartthings-cli: Command Line Interface (CLI) for the SmartThings APIs. Provides CRUD operations for platform artifacts as well as ability to control devices.
Any idea what the problem was installing with npm? This looks like a big hassle!
I think there was some problem with versioning in the oclif module. I noticed there was a correction in github involving this a day or two ago, and now they’ve pushed out 0.0.0-pre.35. I was just able to install it without a problem using npm, so it appears to be fixed.
@TAustin when I installed it this way on a RPI, the only commands I have available are edge and plugins. I’m missing the other commands like capabilities.
I’m afraid I don’t know what to suggest. I haven’t had to install the cli from scratch in quite a while so I don’t know if there are any new issues.
I figured it out. I had to downgrade node to 16.x.
I’m still on 15. What version was causing you problems?