A mutation error occurred after the project was submitted vue

ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `node build/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build 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!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2020-08-24T06_18_23_194Z-debug.log

Insert picture description here
The current error situation is:
after the project code is submitted, an error is reported after recompilation.
Previously, this port was occupied. Now check your own port and find that this port is not started at all.
1) Enter cmd in "Run"

2) Enter netstat -ano in the command line to get the PID corresponding to the port number as shown in the figure

Check 80 port, the corresponding PID and write it down
. Insert picture description here

Insert picture description here
What to do with this. . .
After thinking about the seats,
we found that it was the wrong setting when we started the project.

  1. Delete delete the "node_modules" folder in the project
  2. Delete package-lock.json. Only need this one, don’t put package-lock.json
  3. Clear npm cache
    Run npm clean cache -f, clear npm cache
    4. Then run npm install, reinstall dependencies
    5. Then repackage
    Run npm run build to package.
    6. Found that there is no error.
    7. Run npm run dev to run the project.
    8. It's OK. The
    core problem is solved:
    delete the package-lock.json file. Here is the file address pointing wrong.

Guess you like

Origin blog.csdn.net/milijiangjun/article/details/108198982