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

Possible to run without "--harmony --use_strict" ? #11

Closed
drschwabe opened this issue Aug 31, 2015 · 6 comments
Closed

Possible to run without "--harmony --use_strict" ? #11

drschwabe opened this issue Aug 31, 2015 · 6 comments
Assignees
Labels

Comments

@drschwabe
Copy link

Hi there, with this module I can only run my app using node --harmony --use_strict myApp.js is there a way to get node-tvdb working without those flags? Unfortunately other modules in my project have issues with those.

@drschwabe drschwabe changed the title Possible to run without "--harmony --use_strict" Possible to run without "--harmony --use_strict" ? Aug 31, 2015
@edwellbrook
Copy link
Owner

Hey, thanks for getting in touch. Which version of node are you using?

@drschwabe
Copy link
Author

node 12.7 without flags returns:

$ node myapp
/myapp/node_modules/node-tvdb/index.js:12
const request = require("request");
^^^^^
SyntaxError: Use of const in strict mode.
...

If you add --harmony it results in a slightly different error:

$ node --harmony myapp
/myapp/node_modules/node-tvdb/index.js:41
class Client {
^^^^^
SyntaxError: Unexpected reserved word

And finally, with --harmony and --use_strict flags node-tvdb has no errors but then a dozen of my other modules do :/

@edwellbrook
Copy link
Owner

if you require('node-tvdb/compat') does this fix the issue?

@edwellbrook
Copy link
Owner

(see second piece of example code in example usage in readme for more info)

@drschwabe
Copy link
Author

Ah, yes requiring node-tvdb/compat does solve it; didn't see that second example there, thank-you.

@edwellbrook
Copy link
Owner

glad to hear its all working now! let me know if you run into any other issues. thanks!

@edwellbrook edwellbrook self-assigned this Aug 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants