req icon indicating copy to clipboard operation
req copied to clipboard

req help, unexpected token error

Open discoverlance-com opened this issue 2 years ago • 7 comments

Describe the bug I installed the req command and tried it, had the following error.

To Reproduce Steps to reproduce the behavior:

  1. Install the req cli with npm i -g req-cli
  2. Create a .req directory with a sample.http file GET https://api.github.com/users/SiddharthShyniben
  3. Run the command req run sample
  4. Also run the command req help
  5. See error
file:///home/user/.config/nvm/versions/node/v16.13.2/lib/node_modules/req-cli/src/index.js:41
                const {version} = (await import('../package.json', {assert: {type: 'json'}})).default
                                                                 ^

SyntaxError: Unexpected token ','
    at ESMLoader.moduleStrategy (node:internal/modules/esm/translators:139:18)
    at ESMLoader.moduleProvider (node:internal/modules/esm/loader:236:14)
    at async link (node:internal/modules/esm/module_job:67:21)

Expected behavior A request should be sent with results on the github user's profile.

Versions (please complete the following information):

  • OS: [e.g. ChromeOS]
  • req: req version also gives the same error so cannot give detail here on the version of req in use

discoverlance-com avatar May 31 '22 21:05 discoverlance-com