【问题标题】:npm start command not working, when I try to run my React application当我尝试运行我的 React 应用程序时,npm start 命令不起作用
【发布时间】:2021-03-11 09:53:49
【问题描述】:

React 已正确安装,其他一切正常,但当我尝试在终端中运行“npm start”时,它给了我以下错误。

这是我的 package.json 代码:

        {
      "name": "r3-ui",
      "version": "0.1.0",
      "private": true,
      "dependencies": {
        "@testing-library/jest-dom": "^5.11.6",
        "@testing-library/react": "^11.2.2",
        "@testing-library/user-event": "^12.2.2",
        "react": "^17.0.1",
        "react-dom": "^17.0.1",
        "react-scripts": "4.0.1",
        "web-vitals": "^0.2.4"
      },
      "scripts": {
        "start": "react-scripts start",
        "build": "react-scripts build",
        "test": "react-scripts test",
        "eject": "react-scripts eject"
      },
      "eslintConfig": {
        "extends": [
          "react-app",
          "react-app/jest"
        ]
      },
      "browserslist": {
        "production": [
          ">0.2%",
          "not dead",
          "not op_mini all"
        ],
        "development": [
          "last 1 chrome version",
          "last 1 firefox version",
          "last 1 safari version"
        ]
      }
    }

【问题讨论】:

  • 删除您的 node_modules 并执行 npm install 并尝试...如果仍然无法正常工作,请分享您的 package.json 文件
  • 不行还是不行

标签: reactjs visual-studio-code npm-start


【解决方案1】:

在 Windows 上命名目录时不要使用&。将UI & Web Design 重命名为UI_Web_Design& 之后的任何内容都被视为命令。

更改目录名称后运行npm start

【讨论】:

    猜你喜欢
    • 2023-03-07
    • 1970-01-01
    • 1970-01-01
    • 2019-10-02
    • 2021-01-08
    • 2020-12-18
    • 2021-12-29
    • 1970-01-01
    相关资源
    最近更新 更多