Open picasso250 opened 3 years ago
we can't change the command name because not everything passed to a script will be something that was installed by npm and will exist with a .cmd
extension, so by adding it implicitly we would break a lot of workflows.
it is somewhat unusual that your command isn't running, seeing as windows supports running commands without the .cmd
extension implicitly. is rollup.cmd
located in your project's node_modules/.bin
directory?
yes, it is. the file exists.
PS E:\picasso250\mathjsui\node_modules\.bin> ls
目录: E:\picasso250\mathjsui\node_modules\.bin
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 2021/4/2 2:14 342 livereload
-a---- 2021/4/2 2:14 288 livereload.cmd
-a---- 2021/4/2 2:14 512 livereload.ps1
-a---- 2021/4/2 6:10 302 mathjs
-a---- 2021/4/2 6:10 322 mathjs.cmd
-a---- 2021/4/2 6:10 793 mathjs.ps1
-a---- 2021/4/2 2:14 308 mime
-a---- 2021/4/2 2:14 271 mime.cmd
-a---- 2021/4/2 2:14 478 mime.ps1
-a---- 2021/4/2 2:14 330 rollup
-a---- 2021/4/2 2:14 282 rollup.cmd
-a---- 2021/4/2 2:14 500 rollup.ps1
-a---- 2021/4/2 2:14 316 sirv
-a---- 2021/4/2 2:14 275 sirv.cmd
-a---- 2021/4/2 2:14 486 sirv.ps1
-a---- 2021/4/2 2:14 320 terser
-a---- 2021/4/2 2:14 277 terser.cmd
-a---- 2021/4/2 2:14 490 terser.ps1
the rollup
without .cmd
is the bash file, which is installed by default.
I tried cmd and powershell, they are the same on that problem.
@picasso250 does this work in v6? From our testing, we can't seem to replicate... can you also ensure you're using the latest v7 (ie. npm i -g npm
)
SEE BELOW | This happened to me too. Is there a way around this?
EDIT: I forgot to install the node modules by doing npm i
. I'm stupid lol
This is happened to me again
Current Behavior:
when run
npm run dev
or if you are Chinese, it shows:
Expected Behavior:
run
npm run dev
it run the script without complain.
Steps To Reproduce:
package.json
with it's own scriptEnvironment:
reason
it is not about
rollup
, it's about npm sending wrong args to windows cmdcurrently, npm do this:
windows complains.
but if you send this:
windows will find it in './node_modules/.bin'
a fix
replace
node_modules\@npmcli\run-script\lib\make-spawn-args.js:18
withof course it is not a "correct" fix, but it works for most scripts.