sh:react-scripts-start:找不到命令

时间:2018-04-18 17:13:10

标签: node.js reactjs npm

我有一个项目无法运行npm start

我在两周内没有碰过这个项目。我昨天唯一做的就是添加一个git存储库,就是它。

当我尝试运行npm start时出现此错误:

sh: react-scripts-start: command not found

npm ERR! file sh

npm ERR! code ELIFECYCLE

npm ERR! errno ENOENT

npm ERR! syscall spawn

npm ERR! bk-react-replica@0.1.0 start: 'react-scripts-start'

npm ERR! spawn ENOENT

npm ERR!

npm ERR! Failed at the bk-react-replica@0.1.0 start script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

我已经查看了其他帖子中关于同样错误的解决方案,但对我来说都没有用。我删除了node_modules目录和package-lock.json文件,然后运行了npm install

但是,我仍然收到相同的错误消息。有谁知道什么是错的?

这是我的package.json文件:

{
  "name": "bk-react-replica",
  "version": "0.1.0",
  "private": true,
  "homepage": "http://qhafeezdomain.dreamhosters.com/projects/bkreplica",
  "dependencies": {
    "antd": "^3.3.0",
    "normalize.css": "^8.0.0",
    "react": "^16.2.0",
    "react-dom": "^16.2.0",
    "react-native-scripts": "^1.13.1",
    "react-redux": "^5.0.7",
    "react-router-dom": "^4.2.2",
     "react-scripts": "^1.1.4",
    "react-scripts-cssmodules": "^1.0.171",
    "redux": "^3.7.2"
  },
  "scripts": {
    "start": "react-scripts-start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  }
}

1 个答案:

答案 0 :(得分:1)

As I will reference you to an answer I provided to a question similar to yours, run this:

 npm i -g npm //which will update npm
 rm -rf node_modules/ && npm cache clean // to remove the existing modules and clean the cache.
 npm install //to re-install the project dependencies.

Edited:

I just noticed your package.json it should be:

  "scripts": {
    "start": "react-scripts start",

not

  "scripts": {
    "start": "react-scripts-start",
相关问题