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

passing arguments via npm script no longer works #345

Open
hp8wvvvgnj6asjm7 opened this issue Apr 16, 2024 · 0 comments
Open

passing arguments via npm script no longer works #345

hp8wvvvgnj6asjm7 opened this issue Apr 16, 2024 · 0 comments

Comments

@hp8wvvvgnj6asjm7
Copy link

hp8wvvvgnj6asjm7 commented Apr 16, 2024

Issue description

When passing arguments, flags are ignored, only what comes after the flag is processed.

** RELATED ** npm/cli#7375

Context

package.json

"dev": "tsnd --cache-directory \".cache\" --watch \"./rithmic-client-alpha/src, ./strategy\" --respawn --clear --no-warnings ./src/index.ts"

npm run dev -- -s main

[ 'C:\\Users\\_\\apps\\node\\node.exe', './src/index.ts', 'main' ]

Versions

Windows 10 (19044.1288)
node v21.7.3
ts-node-dev@2.0.0
npm@10.5.2

Did you try to run with ts-node?

yes, and it works as expected:

C:\Users\_\projects\xyz\projects\xyz> ts-node src/index.ts -- -s main
[
  'C:\\Users\\_\\apps\\node\\node_modules\\ts-node\\dist\\bin.js',
  'C:\\Users\\_\\projects\\xyz\\projects\\xyz\\src\\index.ts',
  '-s',
  'main'
]

Did you try to run with --files option enabled?

no

Did you try to run with --debug option enabled?

yes

[DEBUG] 20:44:45 Starting child process -r C:/Users/_/AppData/Local/Temp/ts-node-dev-hook-24350054343735494.js --no-warnings C:\Users\_\apps\node\node_modules\ts-node-dev\lib\wrap.js ./src/index.ts main

this works too:

ts-node-dev src/index.ts -- -s main

this doesn't:

npm run dev -- -s main

Do you have a repro example (git repo) with simple steps to reproduce your problem?

no

@hp8wvvvgnj6asjm7 hp8wvvvgnj6asjm7 changed the title passing arguments no longer works - Apr 16, 2024
@hp8wvvvgnj6asjm7 hp8wvvvgnj6asjm7 changed the title - passing arguments via npm script no longer works Apr 16, 2024
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

1 participant