5

在 package.json 文件中:

"scripts": {    

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

}

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

npm run dev 

但我收到以下错误:-

$ npm run dev

 ./scripts/dev_parallel.sh

'.' is not recognized as an internal or external command, operable program or batch file.
4

1 回答 1

5

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

前:

"scripts": {
    "build": "./node_modules/.bin/drupal-gutenberg-translations && ./node_modules/.bin/drupal-js-build --css"
},

后:

"scripts": {
    "build": "%INIT_CWD%/node_modules/.bin/drupal-gutenberg-translations && %INIT_CWD%/node_modules/.bin/drupal-js-build --css"
},
于 2020-12-02T13:16:07.533 回答