gpt4 book ai didi

linux - Angular2 未处理的 'error' 事件

转载 作者:太空宇宙 更新时间:2023-11-04 10:40:15 24 4
gpt4 key购买 nike

我在 ubuntu 15 上用 ts 构建了一个 angular 2 的仪表板。但是,

在我的输入和 Node 模块所在的 retail-dashboard 文件夹中使用 npm start 进行编译时,我遇到了 npm 错误。它将打开一个网页,但它没有加载任何错误 conn refused

我现在处于停顿状态,不知道该做什么

npm-debug.log

`0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/nodejs', '/usr/bin/npm', 'run', 'lite' ]
2 info using npm@3.6.0
3 info using node@v5.6.0
4 verbose run-script [ 'prelite', 'lite', 'postlite' ]
5 info lifecycle angular2-quickstart@1.0.0~prelite: angular2-quickstart@1.0.0
6 silly lifecycle angular2-quickstart@1.0.0~prelite: no script for prelite, continuing
7 info lifecycle angular2-quickstart@1.0.0~lite: angular2-quickstart@1.0.0
8 verbose lifecycle angular2-quickstart@1.0.0~lite: unsafe-perm in lifecycle true
9 verbose lifecycle angular2-quickstart@1.0.0~lite: PATH: /usr/lib/node_modules/npm/bin/node-gyp-bin:/home/timothy/Dev/retail-dashboard/node_modules/.bin:/usr/lib/node_modules/npm/bin/node-gyp-bin:/home/timothy/Dev/retail-dashboard/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
10 verbose lifecycle angular2-quickstart@1.0.0~lite: CWD: /home/timothy/Dev/retail-dashboard
11 silly lifecycle angular2-quickstart@1.0.0~lite: Args: [ '-c', 'lite-server' ]
12 silly lifecycle angular2-quickstart@1.0.0~lite: Returned: code: 1 signal: null
13 info lifecycle angular2-quickstart@1.0.0~lite: Failed to exec lite script
14 verbose stack Error: angular2-quickstart@1.0.0 lite: `lite-server`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/lib/utils/lifecycle.js:232:16)
14 verbose stack at emitTwo (events.js:100:13)
14 verbose stack at EventEmitter.emit (events.js:185:7)
14 verbose stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/lib/utils/spawn.js:24:14)
14 verbose stack at emitTwo (events.js:100:13)
14 verbose stack at ChildProcess.emit (events.js:185:7)
14 verbose stack at maybeClose (internal/child_process.js:827:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
15 verbose pkgid angular2-quickstart@1.0.0
16 verbose cwd /home/timothy/Dev/retail-dashboard
17 error Linux 4.2.0-27-generic
18 error argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "lite"
19 error node v5.6.0
20 error npm v3.6.0
21 error code ELIFECYCLE
22 error angular2-quickstart@1.0.0 lite: `lite-server`
22 error Exit status 1
23 error Failed at the angular2-quickstart@1.0.0 lite script 'lite-server'.
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 angular2-quickstart package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error lite-server
23 error You can get information on how to open an issue for this project with:
23 error npm bugs angular2-quickstart
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls angular2-quickstart
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]`

最佳答案

我遇到了同样的问题,并通过发出以下命令使其正常工作:

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

如解释here ,系统对用户可以观看的文件数量有限制。显然你可以用完 watch 。此命令增加了用户可以拥有的最大 watch 数量。

我首先找到了解决方案 here ,然后跟踪到 stackoverflow 帖子。

希望对您有所帮助!

关于linux - Angular2 未处理的 'error' 事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35457437/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com