To solve the problem of NPM run eject error in react
Recently, I began to learn react. I used create react app to initialize a react project. Then I found that I wanted to configure webpack manually, but I didn’t know where it was. I found that I was using BD to configure webpack package.json There’s a bunch of code in the
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
NPM run eject code> will copy all dependent files and corresponding dependencies (
webpack code>,
Babel code>) to your project. It's a single operation. Once
eject code>, you can't go back. If you want to go back to the normal project, you have to Re
NPM install create react app - G code>
It was found that the following error was reported when executing NPM run eject code>:
checked online, which means that the problem here is that the scaffold adds . Gitgnore code> files, but there is no local warehouse, which can be used normally according to the following order
git init
git add .
git commit -m 'init'
Then execute NPM run eject code> again, and the execution is successful.
after the execution is completed, it is found that package.json It's like this:
"scripts": {
"start": "node scripts/start.js",
"build": "node scripts/build.js",
"test": "node scripts/test.js"
},
The last line of code was deleted by the system itself, not by me!
That's all for today
Reprint should be marked, thank you!
Read More:
- webstorm npm install –save –save-exact –loglevel error react react-dom react-scripts has failed.
- An error is reported when using react app rewired to start the react project
- Perfectly solve the problem of NPM start error: cannot find module ‘XX’
- NPM run build error solution
- NPM run serve reported an error “NPM err! Missing script: start”
- react Error: Unable to resolve module mobx-react
- NPM run build failed to package err! Missing script: build
- Failed to load plugin react: cannot find module ‘eslint plugin react’ appears when running Vue project‘
- To solve the problem of failed to load: data in HTML5 game running rmmv locally/ actors.json problem
- Solve the problem that the newly installed CodeBlocks cannot be compiled and run
- [W xx:xx:xx.xxx NotebookApp] 404 GET/static/components/react/react-dom.production.min.js (::1)
- 【react】 tsconfig.json Configuration of react JSX error reporting solution in
- NPM run dev error: cannot find module ‘webpack cli / bin / config yargs‘
- Error failed to compile with 1 errors after finding NPM run dev
- npm run devstart error: Error: Unable to find module ‘semver’
- Solve the problem of Python in Windows environment: Fatal error in launcher: Unable to create process using'”‘ in pip installation
- After NPM run dev is running, the browser does not respond and reports an error in. / ~ / Babel loader / lib! / ~ / Vue loader / lib/ selector.js?type=script&in
- How to solve the cross domain problem of Axios in Vue project
- Solve the problem of using in tensoft 2. X tf.contrib.slim No module named appears in the package: tensorflow.contrib problem
- Error: A cross-origin error was thrown. React doesn’t have access to the actual error object in deve