'npm start'命令不执行任何操作

时间:2019-11-25 09:37:16

标签: javascript node.js reactjs npm npm-start

我正在尝试启动react js项目,但是npm start命令什么也没做。没有错误讯息。没有例外。没事。

enter image description here

我已经在start文件中有了一个package.json脚本。

  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },

我还检查了缺少的依赖项,但没有丢失。

我这里缺少什么吗?

3 个答案:

答案 0 :(得分:2)

尝试将npm run用于脚本,就像

npm run start

答案 1 :(得分:2)

解决方案:

我的npm ignore-scripts设置为true。因此,我将其设置为false,并且npm start命令起作用。

npm config set ignore-scripts false

要检查您的ignore-scriptstrue还是false

npm config get ignore-scripts

感谢@RobC的回答 NPM run * doesn't do anything

答案 2 :(得分:0)

我认为这只是一个错误。尝试再次运行该命令,看看现在是否可以运行。或者,如果问题仍然存在,请创建另一个应用程序,然后按照说明进行操作。不要忘记按照指示cd your_project_name签入项目目录。还有另一件事:您是如何创建应用的?

相关问题