首页 > 解决方案 > NPM - 构建 Angular App ELIFECYCLE 时出现节点错误 - 安装 Angular cli 后出现 errno 139

问题描述

今天我安装了 angular-cli,我遇到了一个问题,由于缺少权限,我一开始无法安装它,后来我用 sudo npm install 安装了它,这导致了我今天一整天都无法修复的问题,所以我被迫在这里问这个问题..

当我构建应用程序的前端部分时,出现此错误:

[INFO] > node ./node_modules/@angular/cli/bin/ng build --prod
[INFO] 
[INFO] Segmentation fault (core dumped)
[INFO] npm ERR! code ELIFECYCLE
[INFO] npm ERR! errno 139
[INFO] npm ERR! app-fe@1.2.0 mavenbuild: `node ./node_modules/@angular/cli/bin/ng build --prod`
[INFO] npm ERR! Exit status 139
[INFO] npm ERR! 
[INFO] npm ERR! Failed at the app-fe@1.2.0 mavenbuild script.
[INFO] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[INFO] 
[INFO] npm ERR! A complete log of this run can be found in:
[INFO] npm ERR!     /home/nikola/.npm/_logs/2020-07-10T16_08_21_554Z-debug.log

值得一提的是,我今天可以在安装 angular-cli 之前成功构建我的应用程序。应用程序没有进行任何更改,我团队中的其他人可以构建它,但由于这些问题我不能。

这是整个日志:https ://pastebin.com/srAAQXmn

我看到一个帖子说当我使用 SUDO 通过 npm 安装任何东西时我犯了一个错误,但我找不到任何解决方案......

标签: node.jsangularnpm

解决方案


推荐阅读