codetheweb / tuyapi

šŸŒ§ An easy-to-use API for devices that use Tuya's cloud services. Documentation: https://codetheweb.github.io/tuyapi.
MIT License
2.06k stars 339 forks source link

Local permissions error on macOS #53

Closed jimbo-83 closed 6 years ago

jimbo-83 commented 6 years ago

I keep getting an issue when running tuya-cli link-wizard around permission access

Error: EACCES: permission denied, open '/Users/James/.config/configstore/@tuyapi/cli.json' You don't have access to this file.

Im a total noob so please help me in child friendly comms!

engelant commented 6 years ago

sudo chown -r James /Users/James/.config/configstore

You're on OSX, right?

jimbo-83 commented 6 years ago

Yes mate, I am. Do I just need to run this command and then run the original one again then? Sorry Iā€™m way out of my depth šŸ˜‚

engelant commented 6 years ago

Yep, that will set the permissions back to you user.

codetheweb commented 6 years ago

Thanks for helping out @engelant.

@jimbo-83 unless you're running tuya-cli with sudo or something, it looks like permissions on your system are messed up. I would suggest repairing your drive in Recovery Mode.

jimbo-83 commented 6 years ago

Thanks for the help guys, @engelant suggestion seems to have resolved the permissions error however I'm now getting this:

Jamess-Mac-mini:~ James$ tuya-cli link-wizard /usr/local/lib/node_modules/@tuyapi/cli/node_modules/@tuyapi/link/index.js:79 TuyaLinkWizard.prototype.linkDevice = async function (options) { ^^^^^^^^ SyntaxError: Unexpected token function at Object.exports.runInThisContext (vm.js:76:16) at Module._compile (module.js:542:28) 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) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object. (/usr/local/lib/node_modules/@tuyapi/cli/lib/link.js:3:41) at Module._compile (module.js:570:32)

jimbo-83 commented 6 years ago

@codetheweb, do you have the older instructions still that use Charles? I was originally trying to use this but can't find the step by step for that method anymore.

engelant commented 6 years ago

To me it looks like you are using an older version of nodejs, as the error complains of an unexpected token, but rund on my setup just fine. >= v7.6 seems to be key here.

codetheweb commented 6 years ago

@jimbo-83 like @engelant said, you need to update your Node version.

The older instructions can be found here.

codetheweb commented 6 years ago

As there hasn't been any activity in the last 17 days on this, I'm closing it. Feel free to re-open it @jimbo-83 if you're still having problems.