'.' 在 npm 中运行脚本时不被识别为内部或外部命令

Har*_*wal 8 node.js package.json npm-scripts

在 package.json 文件中:

"scripts": {    

   "dev": "./scripts/dev_parallel.sh",

}
Run Code Online (Sandbox Code Playgroud)

我正在尝试通过输入以下内容来运行 shell 脚本:

npm run dev 
Run Code Online (Sandbox Code Playgroud)

但我收到以下错误:-

$ npm run dev

 ./scripts/dev_parallel.sh

'.' is not recognized as an internal or external command, operable program or batch file.
Run Code Online (Sandbox Code Playgroud)

小智 8

改变 '。' 在 Windows 上使用“%INIT_CWD%”。

前:

"scripts": {
    "build": "./node_modules/.bin/drupal-gutenberg-translations && ./node_modules/.bin/drupal-js-build --css"
},
Run Code Online (Sandbox Code Playgroud)

后:

"scripts": {
    "build": "%INIT_CWD%/node_modules/.bin/drupal-gutenberg-translations && %INIT_CWD%/node_modules/.bin/drupal-js-build --css"
},
Run Code Online (Sandbox Code Playgroud)