angular - 使用 Angular 在 Linux 下编译现有项目?
问题描述
我们需要编译一个现有的 Angular 项目,该项目是在 Linux 中在 Windows 10 下成功开发和编译的。
起初我在 Windows 10 中安装了 WSL Ubuntu。我做得npm install
很好。然后我尝试使用ng build --prod --base-href /IC/
(在 Windows 上工作)构建我的项目并坚持下去
92% chunk asset optimization TerserPlugin
我在网上阅读并了解到这是在 WSL 上运行的常见问题。所以我在 hyper-v 下设置了一个 Ubuntu VM,安装了 node 和 npm 并再次尝试。
这一次,在运行时npm install
我遇到了一些错误,但是如果我运行,sudo npm install
我会传递这些错误并看到node-sass@4.11.0
编译了一些 c 文件,然后失败并显示以下内容:
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.11.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.11.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/ophir/.npm/_logs/2019-11-17T09_53_45_418Z-debug.log
关于如何在 Linux 上编译 Angular 项目的任何想法?
解决方案
推荐阅读
- video-streaming - Angular 的 AWS KVS 流问题
- flutter - 如何阻止列表视图在列内溢出?
- python - 通过循环将文件设置为数据帧
- powershell - Sharepoint Online ExecuteQuery 上的 Powershell 错误
- django - django-filter 如何在基于类的视图中调用?
- android - Firebase 身份验证中突然添加了多个帐户
- python - RaggedTensor 的 TensorFlow 广播
- express - 如何使用 express js 应用程序获取 bitbucket 私有存储库?
- javascript - 在 html 表单中禁用自动填充
- python - 类别中的不同列值