npm not running scripts in package.json

Raj*_*jan 1 javascript node.js npm npm-scripts

The problem is that when I do npm start OR npm run customScriptCommand npm just not doing anything with the project and quickly just return new line in the terminal.

我已经尝试从我的机​​器上删除 node 和 npm,然后为 node 和 npm 进行 brew 安装,但它没有解决问题。

然后我尝试从 brew 安装中删除 node 和 npm 并从 nvm 再次安装它,但它也没有解决问题。

新产品详情

npm -v -> 6.11.3
which npm -> /usr/local/bin/npm
Run Code Online (Sandbox Code Playgroud)

NodeJS 详细信息

node -v -> v12.12.0
which node ->/usr/local/bin/node
Run Code Online (Sandbox Code Playgroud)

package.json 中的脚本

"scripts": {
    "start": "node ./bin/www",
    "devstart": "DEBUG=app-name:* nodemon ./bin/www", //I've changed my actual app name to "app-name"
  },
Run Code Online (Sandbox Code Playgroud)

如果我这样做node ./bin/wwwDEBUG=app-name:* nodemon ./bin/www它会起作用:

在此处输入图片说明

更新

  • 我试着在不有我的同事的机器上的问题,与其他项目git clonenpm install,并试图运行该项目,但它还是没有

  • 即使我刚刚做的新项目npm init -y失败了,

{
   "name": "test"
   "version": "1.0.0",
   "description": "",
   "main": "index.js",
   "scripts": {
       "test": "echo \"Error: no test specified\" && exit 1"
   },
   "keywords": [],
   "author": "itsme",
   "license": "ISC"
}
Run Code Online (Sandbox Code Playgroud)

Vip*_*waj 12

npm config set ignore-scripts false 会为你做的伎俩。

斗争是真实的,我的朋友,从现在开始不再遵循随机教程。

https://github.com/npm/cli/issues/541