【问题标题】:'.' is not recognized as an internal or external command in running script in npm'。在 npm 中运行脚本时不被识别为内部或外部命令
【发布时间】:2018-01-10 00:51:10
【问题描述】:

在 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.

【问题讨论】:

标签: node.js package.json npm-scripts


【解决方案1】:

改变'.'在 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"
},

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-01-25
    • 2018-10-19
    • 2018-07-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-02-03
    相关资源
    最近更新 更多