ser*_*rah 5 angular-cli angular
当我尝试构建产品(ng build --prod)时,我的角度项目无法构建。请注意ng build似乎工作正常。
当我尝试使用 --prod 选项构建时出现以下错误
Error: ENOENT: no such file or directory, mkdir 'C:\dev\workspaces\intellij-workspaces\myproject\web\target\frontend'
at Error (native)
at Object.fs.mkdirSync (fs.js:922:18)
Run Code Online (Sandbox Code Playgroud)
我已将 Angular-cli outDir 设置如下
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "web"
},
"apps": [
{
"root": "src",
"outDir": "../../../target/frontend",
"deployUrl": "myproject-dashboard/",
"assets": [
"assets",
"favicon.ico"
],
Run Code Online (Sandbox Code Playgroud)
我的 package.json 和 angular-cli.json 文件位于 myproject/web/src/main/frontend 下
因此,理想情况下,基于 angular-cli.json 中为 outDir 设置的相对路径,我希望在myproject/web文件夹下创建一个名为 target 的文件夹,并且我的所有构建输出都可以在那里使用。
请您告诉我是否应该手动创建目标文件夹,或者是否有办法告诉 angular-cli 自动创建它?
小智 0
我也遇到了这个问题,我所做的解决方法是将其添加到我的 package.json 文件中:
"scripts": {
// ...
"build": " mkdir dist && ng build --prod"
},
Run Code Online (Sandbox Code Playgroud)
(假设您的目标文件夹是 dist)
| 归档时间: |
|
| 查看次数: |
5037 次 |
| 最近记录: |