[英]how to fix this npm start not working ( after npx create-react-app )
npm ERR. code ELIFECYCLE npm ERR. errno 1 npm ERR: todos-clone-app@0.1.0 start. `react-scripts start` npm ERR. Exit status 1 npm ERR. npm ERR: Failed at the todos-clone-app@0.1.0 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /home/josh/.npm/_logs/2020-08-21T19_28_35_521Z-debug.log
Edit:编辑:
package.json package.json
{
"name": "todos-clone-app",
"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",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-scripts": "3.4.3",
"webpack-dev-server": "^3.11.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" ]
}
}
Try deleting your node_modules
directory and package-lock.json
file.尝试删除您的node_modules
目录和package-lock.json
文件。 Then run npm install
.然后运行npm install
。
In my case, it was because of not being in the right folder.就我而言,这是因为不在正确的文件夹中。
Generally, I create a folder and go to Vs code to open it for typing create-react-app "folder name" to the console.通常,我创建一个文件夹和 go 到 Vs 代码以打开它,以便在控制台中键入 create-react-app“文件夹名称”。
The problem was I was trying to npm start in parent folder instead of "folder name".问题是我试图在父文件夹而不是“文件夹名”中启动 npm。
all you have to do is你所要做的就是
1-cd folder name 1-cd 文件夹名称
2-npm start. 2-npm 开始。
It should work.它应该工作。
try=> npx create-react-app./ it worked for me try=> npx create-react-app./ 它对我有用
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.