Nuxt.js server deployment package error

npm run build reports error,
error content is as follows,

clipboard.png

after checking, I found that the original nuxt project can run nuxt start and nuxt build normally, so I also have the problem of adding plug-ins nuxtproxy and nuxtaxios. But because local developers need to use it.

when troubleshooting the problem, I found that
when I set the following in package.json,

"scripts": {
    ...
    "build": "nuxt build && npm start",
    "start": "nuxt start",
    ...

will report the error in the diagram and change it to

.
"scripts": {
    ...
    "build": "nuxt build",
    "start": "nuxt start",
    ...

will run normally, and then when I run the npm start command, I will report an error again. Who knows why?

Mar.04,2021
Menu