当我尝试 运行 我的 React 应用程序时,npm start 命令不起作用
npm start command not working, when I try to run my React application
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"
]
}
}
在 Windows 上命名目录时不要使用 &
。将 UI & Web Design
重命名为 UI_Web_Design
。 &
之后的任何内容都被视为命令。
更改目录名称后运行 npm start
.
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"
]
}
}
在 Windows 上命名目录时不要使用 &
。将 UI & Web Design
重命名为 UI_Web_Design
。 &
之后的任何内容都被视为命令。
更改目录名称后运行 npm start
.