Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reinstalled WebOS SDK through npm on Windows 11, still getting 'ares-setup-device' is not recognized as an internal or external command,operable program or batch file. #37

Open
TehDomic opened this issue May 26, 2024 · 6 comments

Comments

@TehDomic
Copy link

Error message:

Error while refreshing TVs

'ares-setup-device' is not recognized as an internal or external command,operable program or batch file.

OK

Have tried installing in both a Standard User account, and Admin User account (via Run ad Administrator), no luck.
I have followed the new instructions from the readme.md file.

@Cathwyler
Copy link
Owner

Hi,

Sorry for late reply.

Make sure ares -V command works in a Window comand prompt
image
This command should work regardless admin right.

If it's not the case, this is a probably an installation issue.
As explained on webOS TV developer website, make sure you properly uninstalled the old CLI.
Make sure you installed Node.js (Recommended versions: 14.15.1 - 16.20.2) with npm.
Unfortunatly i'm not a Node.js npm thing specialist and my troubleshouting knowledge is a bit limited

@TehDomic
Copy link
Author

Yes, I properly uninstalled the old SDK and custom environment variables we setup together a few months ago, and ares -V isn't found any way I install it via npm.

@Cathwyler
Copy link
Owner

try this one in a command prompt npm list -g
image

@TehDomic
Copy link
Author

Yes, it's installed there, but ares commands don't work. (Tried in both PowerShell and CMD). Adding node.exe as prefix runs the commands with added red warning texts from node.exe

@TehDomic
Copy link
Author

TehDomic commented May 29, 2024

Troubleshooting:

PS C:\Users\Not-Admin> npm install -g @webos-tools/cli
npm warn deprecated har-validator@5.1.5: this library is no longer supported
npm warn deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm warn deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm warn deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.

added 300 packages in 14s

1. ares -V "runs", but

> ares -V
(node:2268) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Version: 3.0.6`

However, MagicRemoveService requires admin rights to run, thus not finding the commands (they are installed regardless to the current user, standard user account).
So I ran the npm install -g @webos-tools/cli as an admin in Windows Terminal (while still logged as the standard user account), and MagicRemoteService does not find the commands either.

2. Installing and running @webos-tools/cli using only Admin account

ares -V
ares: The term 'ares' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

MagicRemoteService with the admin account logged in, does not find ares either.
Odd, since ares -V was found in a standard user terminal before.

Conclusion

Not sure of a solution, but I suspect you need to make sure your server software needs to include the Node.js enviroment variables (Paths) now, or manually add the directory location of the installation?
I found some interesting files you might want to use:
C:\Program Files\nodejs\node.exe
and
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Node.js\Node.js command prompt.lnk that uses the command:

C:\Windows\System32\cmd.exe /k "C:\Program Files\nodejs\nodevars.bat"

Ideas

The path to a Windows admin account's npm folder can always be reached with these paths (assuming process has been given admin privilege escalation)
cmd.exe %APPDATA%\npm\
Powershell: $env:APPDATA\npm\

It's kind of a big problem that

  1. MagicRemoteService is not installed anywhere, thus potentially stored under a user's directory, and needs to run as Admin to work.
  2. Node.js installs npm packages under the current user's directory, (a Windows design problem), potentially locking MagicRemoteService out of the files it needs to operate properly.

C:\webos_sdk_dir_name_here\ was at least accessible to everyone.

If you figure out a solution, @ me and I'll test it for you.

@TehDomic
Copy link
Author

Update: I created a related issue over at webos-tools/cli#8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants