![](/img/trans.png)
[英]After creating app using npx create-react-app <myproject> , and start app by using "npm start" i got this error mentioned below
[英]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
編輯:
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" ]
}
}
嘗試刪除您的node_modules
目錄和package-lock.json
文件。 然后運行npm install
。
就我而言,這是因為不在正確的文件夾中。
通常,我創建一個文件夾和 go 到 Vs 代碼以打開它,以便在控制台中鍵入 create-react-app“文件夾名稱”。
問題是我試圖在父文件夾而不是“文件夾名”中啟動 npm。
你所要做的就是
1-cd 文件夾名稱
2-npm 開始。
它應該工作。
try=> npx create-react-app./ 它對我有用
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.