node.js - 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 安装任何东西时我犯了一个错误,但我找不到任何解决方案......
解决方案
推荐阅读
- laravel - 文件预览不可见,文件链接在 laravel 文件管理中不起作用
- amazon-web-services - Will AWS Glue Spark Job Bookmark reprocess failed jobs?
- ruby-on-rails - 如何将 Rails 应用程序的 docker 容器日志通过管道传输到 aws cloud-watch
- javascript - 如何从 Android 中的 org.mozilla.NativeArray 获取值?
- javascript - 在 Safari 14.0.2 上,MediaRecorder dataavailable 处理程序捕获空 blob
- python - 比较两个数据框,只获取索引和列名不匹配的值 pandas dataframe python
- angular - 角度禁用/启用后退按钮
- angular - Angular 10 pwa 服务工作者没有更新最新的缓存
- rust - 导入宏时编译器功能冲突
- php - 循环 PHP file_get_contents 并执行 put 请求