Vue elemnt admin NPM run dev run error
Description:
vue-element-admin 4.4.4
There is the previous Vue element admin template in the computer, which can run normally, but the following error will be prompted when pulling the latest version
Error content
DONE Compiled successfully in 4163ms 4:26:31 ├F10: PM┤
App running at:
- Local: http://localhost:9528
- Network: http://192.168.70.192:9528
Note that the development build is not optimized.
To create a production build, run npm run build.
events.js:291
throw er; // Unhandled 'error' event
^
Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:273:12)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn cmd',
path: 'cmd',
spawnargs: [ '/c', 'start', '""', '/b', 'http://localhost:9528' ]
}
Solution:
Comment out open: true in vue.config.js
Description of the modified part
For vue projects, find the devServer configuration proxy in vue.config.js
devServer: {
port: 8081, // port
// open: true, // whether to open the browser automatically
overlay: {
warnings: false,
errors: true
},
hot: true, // simply set to true, if the compiler reports an error, it will throw an error and you change it to the correct one, which will trigger a recompile again and the whole browser will be refreshed!
headers: {
'Access-Control-Allow-Origin': '*', //Allows access to all domains
'Access-Control-Allow-Credentials': 'true' // whether to allow subsequent requests to carry authentication information (cookies), the value can only be true, otherwise do not return
},
host: '0.0.0.0',
proxy: { // proxy
'/admin': {
target: 'http://192.168.1.100:8080', // backend port address
changeOrigin: true, // option to host the site virtually based on the name, if not configured, the request will report a 404 If the interface crosses the domain, this parameter needs to be configured
ws: true, // true/false, whether to proxy websockets
secure: false, // if the interface is https, you need to configure this parameter
pathRewrite: {
'^/admin': '' // pathRewrite is the request path to redirect to match the correct request address when using the proxy for proxying
}
}
}
}
Read More:
- npm run dev Error: opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error‘ ]
- [Solved] Node.js v17 npm run dev Error: opensslErrorStack
- NPM run dev runs the Vue project and reports an error: Node Sass does not yet support your current environment
- [Solved] NUXT.JS. npm run dev Error: Error: error:0308010C:digital envelope routines::unsupported
- [Solved] NPM err! Cannot read property ‘parent’ of null npm ERR! A complete log of this run can be found in: npm ERR!
- ‘webpack dev server’ is not an internal or external command, nor is it a runnable program or batch file. Solution: error in cnpm run dev:
- [Solved] npm run start Run Error: Missing script: “start“
- Vue Use ‘npm run dev’ Error: Error: Unknown option ‘–inline‘ [How to Solve]
- [Solved] npm run start Error: Exit status 3221225477
- “Failed to load resource: net::ERR_FILE_NOT_FOUND” error. The project created by vue-cli 3.0 can run under dev, and an error is reported after packaging, and the page is blank.
- [Solved] To install it, you can run: npm install –save core-js/modules/es.error.cause.js
- [Solved] npm Install vuex Error: npm ERR! code ERESOLVE
- [Weex]Error in creating project NPM: unable to load file D:\program files\nodejs\node_ global\ weex.ps1 Because scripts are not allowed to run on this system.
- Front end initialization Vue element admin error [How to Solve]
- [Solved] Package Install Error: npm ERR code ERR_SOCKET_TIMEOUT npm ERR
- [Solved] Vue Start Project Error: ValidationError: webpack Dev Server Invalid Options
- [Solved] NPM node ERROR in main..js from Terser ChildProcessWorker.initialize Excaption
- [Solved] error when starting dev server:Error: The following dependencies are imported but could not be reso
- npm connect ETIMEDOUT Error [How to Solve]
- npm ERR code ELIFECYCLE [How to Solve]