当我更新nuxt.config.js时,Dev服务器崩溃

问题描述 投票:0回答:1

我正在使用nuxt进行新项目,开发服务器运行平稳,每当我更新代码时,热重装就可以工作。唯一的问题是nuxt.config.js,当我更新文件时,开发服务器崩溃并在终端中出现以下错误。

↻ Updated nuxt.config.js                                                                                                            21:09:59
events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: stream.push() after EOF
    at readableAddChunk (_stream_readable.js:240:30)
    at ReaddirpStream.Readable.push (_stream_readable.js:208:10)
    at ReaddirpStream._read (/home/zed/workspace/fire_app/fire_app/fire_app/frontend/node_modules/readdirp/index.js:140:22)
    at <anonymous>

npm ERR! Linux 4.15.0-74-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "dev"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! [email protected] dev: `nuxt`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] dev script 'nuxt'.
npm ERR! Make sure you have the latest version of node.js and npm installed.

这是npm-debug.log文件

1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'dev' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle [email protected]~predev: [email protected]
6 silly lifecycle [email protected]~predev: no script for predev, continuing
7 info lifecycle [email protected]~dev: [email protected]
8 verbose lifecycle [email protected]~dev: unsafe-perm in lifecycle true
9 verbose lifecycle [email protected]~dev: PATH: /usr/share/npm/bin/node-gyp-bin:/home/zed/workspace/fire_app/fire_app/frontend/node_modules/.bin:/home/zed/Qt5.13.0/5.13.0/gcc_64/bin/:/home/zed/go/bin:/usr/local/go/bin:/home/zed/Qt5.13.0/5.13.0/gcc_64/bin/:/home/zed/go/bin:/usr/local/go/bin:/home/zed/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/zed/go/bin:/home/zed/go/bin
10 verbose lifecycle [email protected]~dev: CWD: /home/zed/workspace/fire_app/fire_app/frontend
11 silly lifecycle [email protected]~dev: Args: [ '-c', 'nuxt' ]
12 silly lifecycle [email protected]~dev: Returned: code: 1  signal: null
13 info lifecycle [email protected]~dev: Failed to exec dev script
14 verbose stack Error: [email protected] dev: `nuxt`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (/usr/share/npm/lib/utils/lifecycle.js:232:16)
14 verbose stack     at emitTwo (events.js:126:13)
14 verbose stack     at EventEmitter.emit (events.js:214:7)
14 verbose stack     at ChildProcess.<anonymous> (/usr/share/npm/lib/utils/spawn.js:24:14)
14 verbose stack     at emitTwo (events.js:126:13)
14 verbose stack     at ChildProcess.emit (events.js:214:7)
14 verbose stack     at maybeClose (internal/child_process.js:925:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
15 verbose pkgid [email protected]
16 verbose cwd /home/zed/workspace/fire_app/fire_app/frontend
17 error Linux 4.15.0-74-generic
18 error argv "/usr/bin/node" "/usr/bin/npm" "run" "dev"
19 error node v8.10.0
20 error npm  v3.5.2
21 error code ELIFECYCLE
22 error [email protected] dev: `nuxt`
22 error Exit status 1
23 error Failed at the [email protected] dev script 'nuxt'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the fireapp_frontend package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     nuxt
23 error You can get information on how to open an issue for this project with:
23 error     npm bugs fireapp_frontend
23 error Or if that isn't available, you can get their info via:
23 error     npm owner ls fireapp_frontend
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

环境:平台:Ubuntu 18.04

Npm版本:3.5.2

节点:v8.10.0

“ nuxt”:“ ^ 2.0.0”,

node.js npm nuxt.js
1个回答
0
投票

如Paul在上述评论中所建议,我更新了NPM和Node,此问题已解决。我按照步骤here

将节点和NPM更新为6.13.4,并将节点更新为v12.14.1

© www.soinside.com 2019 - 2024. All rights reserved.