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

GOT require issue #1084

Closed
2 tasks done
khizarsonu opened this issue Feb 23, 2020 · 4 comments
Closed
2 tasks done

GOT require issue #1084

khizarsonu opened this issue Feb 23, 2020 · 4 comments

Comments

@khizarsonu
Copy link

khizarsonu commented Feb 23, 2020

Describe the bug

  • Node.js version: 8.17.0
  • OS & version: macos

Actual behavior

gives below error
/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:617:28)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.
...

Expected behavior

console.log should print object information about got
...

Code to reproduce

const got = require('got');
console.log(got);

Checklist

  • I have read the documentation.
  • I have tried my code with the latest version of Node.js and Got.
@khizarsonu
Copy link
Author

khizarsonu commented Feb 23, 2020

as i see GOT works fine in node 12+ , in case got does not support older version on nodejs, then please highlight and mention it in the documentation.
this will save a lot of time of developer facing similar issue

@sindresorhus
Copy link
Owner

Got already indicates the required Node.js version in package.json

@dhamodharan99
Copy link

I ran the following command on 2 versions.

npm install -g bootprint
npm install -g bootprint-openapi
bootprint openapi http://petstore.swagger.io/v2/swagger.json target
bootprint openapi http://petstore.swagger.io/v2/swagger.json openapi

With node version v8.9.1, this is not working. With the node version v10.16.3 the above codes are working.
(
image )

@huydox
Copy link

huydox commented Nov 1, 2021

I got the same error in NodeJS v15.14.0 and latest Got

/node_modules/got/dist/source/create.js:157
      const paginateEach = (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:606:28)
      at Object.Module._extensions..js (module.js:653:10)
      at Module.load (module.js:561:32)
      at tryModuleLoad (module.js:504:12)
      at Function.Module._load (module.js:496:3)
      at Module.require (module.js:586:17)
      at require (internal/module.js:11:18)
      at Object.<anonymous> (/Users/huydo/Dev/CorpTek/cardioscope-desktop-electron/node_modules/got/dist/source/index.js:14:18)```

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

4 participants