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

Throwing Exceptions #68

Closed
hpnotiqballin opened this issue Mar 27, 2020 · 1 comment
Closed

Throwing Exceptions #68

hpnotiqballin opened this issue Mar 27, 2020 · 1 comment

Comments

@hpnotiqballin
Copy link

Had this working a few weeks ago, but is now throwing exceptions left and right. First it was this:
/usr/local/lib/node_modules/@tuyapi/cli/node_modules/got/dist/source/create.js:101
got.paginate = async function* (url, options) {
^

SyntaxError: Unexpected token *
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:616:28)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object. (/usr/local/lib/node_modules/@tuyapi/cli/node_modules/got/dist/source/index.js:7:18)

So I removed the offending asterick from the code, now it is throwing this on ANY tuya-cli command (even just the simple -h flag):

/usr/local/lib/node_modules/@tuyapi/cli/node_modules/got/dist/source/create.js:120
yield item;
^^^^^

SyntaxError: Unexpected strict mode reserved word
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object. (/usr/local/lib/node_modules/@tuyapi/cli/node_modules/got/dist/source/index.js:7:18)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)

What gives? Am I just missing something dumb? I'm running Node.js version 10.19.0, but tried it on versions 8 and 9 as well.

@codetheweb
Copy link
Member

You need to upgrade Node to at least 12.0.0. nvm is very useful if you're not using it already.

In general, it's not a good idea to manually edit files in node_modules/. 😛

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