我在reactjs中遇到了npm start的问题,会发生什么?

时间:2020-06-16 01:49:49

标签: npm package.json

这是我的package.json文件:

{
  "name": "front-end",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^4.2.4",
    "@testing-library/react": "^9.5.0",
    "@testing-library/user-event": "^7.2.1",
    "boostrap": "^2.0.0",
    "bootstrap": "^4.5.0",
    "react": "^16.13.1",
    "react-dom": "^16.13.1",
    "react-redux": "^7.2.0",
    "react-router-dom": "^5.2.0",
    "react-scripts": "3.4.1",
    "reactstrap": "^8.4.1",
    "redux": "^4.0.5",
    "redux-devtools-extension": "^2.13.8",
    "redux-thunk": "^2.3.0"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"

  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

当我运行npm start时,将显示以下消息:

npm ERR! missing script: start
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\...\Roaming\npm-cache\_logs\2020-06-16T01_36_35_559Z-debug.log 

1 个答案:

答案 0 :(得分:1)

您需要在package.json所在的目录或子目录中运行此命令。您可以使用pwd检查当前目录,并使用cd NEW_DIRECTORY进行更改。