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

Using -r esm broke with 6.0 release #236

Closed
daveisfera opened this issue Oct 14, 2020 · 1 comment · Fixed by #237
Closed

Using -r esm broke with 6.0 release #236

daveisfera opened this issue Oct 14, 2020 · 1 comment · Fixed by #237

Comments

@daveisfera
Copy link

When running this command: node_modules/.bin/node-dev -r esm --inspect=0.0.0.0:9229 test_inspect.js

I get this error:

/Users/dlj/projects/test_inspect/node_modules/resolve/lib/sync.js:91
    throw err;
    ^

Error: Cannot find module '--inspect=0.0.0.0:9229' from '/Users/dlj/projects/test_inspect'
    at resolveSync (/Users/dlj/projects/test_inspect/node_modules/resolve/lib/sync.js:89:15)
    at module.exports (/Users/dlj/projects/test_inspect/node_modules/node-dev/lib/resolve-main.js:4:10)
    at getConfig (/Users/dlj/projects/test_inspect/node_modules/node-dev/lib/cfg.js:31:16)
    at Object.<anonymous> (/Users/dlj/projects/test_inspect/node_modules/node-dev/lib/wrap.js:14:34)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at Module._preloadModules (internal/modules/cjs/loader.js:1277:12) {
  code: 'MODULE_NOT_FOUND'
}

And unfortunately, using NODE_OPTIONS doesn't work (see #235)

@bjornstar
Copy link
Collaborator

It looks like an argument parsing issue, it works if the order is changed to:

node_modules/.bin/node-dev --inspect=0.0.0.0:9229 -r esm test_inspect.js

The argument parsing did change a bit in v6, let me see if I can fix it.

bjornstar added a commit to bjornstar/node-dev that referenced this issue Oct 15, 2020
- Manually wrangle node args so that we can handle `--` args coming before `-` args (Fixes fgnass#236)
bjornstar added a commit to bjornstar/node-dev that referenced this issue Oct 15, 2020
- Manually wrangle node args so that we can handle `--` args coming before `-` args (Fixes fgnass#236)
bjornstar added a commit to bjornstar/node-dev that referenced this issue Oct 15, 2020
- Manually wrangle node args so that we can handle `--` args coming before `-` args (Fixes fgnass#236)
bjornstar added a commit to bjornstar/node-dev that referenced this issue Oct 15, 2020
- Manually wrangle node args so that we can handle `--` args coming before `-` args (Fixes fgnass#236)
bjornstar added a commit that referenced this issue Oct 15, 2020
- Manually wrangle node args so that we can handle `--` args coming before `-` args (Fixes #236)
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

Successfully merging a pull request may close this issue.

2 participants