[BUG] Backslashes in additional arguments given to npm run scripts are escaped wrongly #3680
Closed
1 task done
Labels
Bug
thing that needs fixing
platform:windows
is Windows-specific
Priority 2
secondary priority issue
Release 7.x
work is associated with a specific npm 7 release
Is there an existing issue for this?
Current Behavior
Note: This bug is similar to #2638 but not the same.
Given the following
package.json
:And this
index.js
:Backslashes in additional arguments to
npm start
are escaped wrongly in most cases, i.e. the script gets viaprocess.argv
two backslashes for each given backslash.Example:
If the additional argument is only a backslash, it works as expected:
Expected Behavior
Given the above example,
process.argv
should look like this:Steps To Reproduce
Via CLI
package.json
index.js
Run
npm start path\to\file
See error...
'path\\\\to\\\\file'
instead of'path\\to\\file'
Environment
The text was updated successfully, but these errors were encountered: