Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 6 ng build--prod未创建dist文件夹_Angular_Typescript_Angular6 - Fatal编程技术网

Angular 6 ng build--prod未创建dist文件夹

Angular 6 ng build--prod未创建dist文件夹,angular,typescript,angular6,Angular,Typescript,Angular6,嗨,我是angular 6的新手,我正在尝试将我的angular 6应用程序放到服务器上,我正在浏览angular.io网站文档中提供的文档,其中说我必须进行ng build--prod,它将创建/dist文件夹,我需要将该文件夹复制到服务器上,但在我的例子中,当我创建ng build--prod,Thanx时,/dift文件夹本身并没有创建 ng build --prod Date: 2018-11-02T09:05:15.509Z Hash: 73a702a04d7ddf767a38 Ti

嗨,我是angular 6的新手,我正在尝试将我的angular 6应用程序放到服务器上,我正在浏览angular.io网站文档中提供的文档,其中说我必须进行ng build--prod,它将创建/dist文件夹,我需要将该文件夹复制到服务器上,但在我的例子中,当我创建ng build--prod,Thanx时,/dift文件夹本身并没有创建

ng build --prod

Date: 2018-11-02T09:05:15.509Z
Hash: 73a702a04d7ddf767a38
Time: 33823ms
chunk {scripts} scripts.0f47d3fbd6308206eae4.js (scripts) 599 kB  [rendered]
chunk {0} runtime.a66f828dca56eeb90e02.js (runtime) 1.05 kB [entry] 
[rendered]
chunk {1} styles.0dacd1919fea938bb6af.css (styles) 424 kB [initial] 
[rendered]
chunk {2} polyfills.47128b287f32f00ed880.js (polyfills) 130 bytes [initial] 
[rendered]
chunk {3} main.179049c6a74691736097.js (main) 128 bytes [initial] [rendered]
angular.json

{
 "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
   "newProjectRoot": "projects",
   "projects": {
    "incident-management": {
     "root": "",
      "sourceRoot": "src",
       "projectType": "application",
       "prefix": "app",
       "schematics": {},
  "architect": {
    "build": {
      "builder": "@angular-devkit/build-angular:browser",
      "options": {
        "outputPath": "dist/incident-management",
        "index": "src/index.html",
        "main": "src/main.ts",
        "polyfills": "src/polyfills.ts",
        "tsConfig": "src/tsconfig.app.json",
        "assets": [
          "src/favicon.ico",
          "src/assets"
        ],
        "styles": [
          "node_modules/@clr/icons/clr-icons.min.css",
          "node_modules/@clr/ui/clr-ui.min.css",
          "src/styles.css"
        ],
        "scripts": [
          "node_modules/@webcomponents/custom-elements/custom-elements.min.js",
          "node_modules/@clr/icons/clr-icons.min.js"
        ]
      },
      "configurations": {
        "production": {
          "fileReplacements": [
            {
              "replace": "src/environments/environment.ts",
              "with": "src/environments/environment.prod.ts"
            }
          ],
          "optimization": true,
          "outputHashing": "all",
          "sourceMap": false,
          "extractCss": true,
          "namedChunks": false,
          "aot": true,
          "extractLicenses": true,
          "vendorChunk": false,
          "buildOptimizer": true
        }
      }
    },
    "serve": {
      "builder": "@angular-devkit/build-angular:dev-server",
      "options": {
        "browserTarget": "incident-management:build"
      },
      "configurations": {
        "production": {
          "browserTarget": "incident-management:build:production"
        }
      }
    },
    "extract-i18n": {
      "builder": "@angular-devkit/build-angular:extract-i18n",
      "options": {
        "browserTarget": "incident-management:build"
      }
    },
    "test": {
      "builder": "@angular-devkit/build-angular:karma",
      "options": {
        "main": "src/test.ts",
        "polyfills": "src/polyfills.ts",
        "tsConfig": "src/tsconfig.spec.json",
        "karmaConfig": "src/karma.conf.js",
        "styles": [
          "src/styles.css"
        ],
        "scripts": [],
        "assets": [
          "src/favicon.ico",
          "src/assets"
        ]
      }
    },
    "lint": {
      "builder": "@angular-devkit/build-angular:tslint",
      "options": {
        "tsConfig": [
          "src/tsconfig.app.json",
          "src/tsconfig.spec.json"
        ],
        "exclude": [
          "**/node_modules/**"
        ]
      }
    }
  }
},
"incident-management-e2e": {
  "root": "e2e/",
  "projectType": "application",
  "architect": {
    "e2e": {
      "builder": "@angular-devkit/build-angular:protractor",
      "options": {
        "protractorConfig": "e2e/protractor.conf.js",
        "devServerTarget": "incident-management:serve"
      },
      "configurations": {
        "production": {
          "devServerTarget": "incident-management:serve:production"
        }
      }
    },
    "lint": {
      "builder": "@angular-devkit/build-angular:tslint",
      "options": {
        "tsConfig": "e2e/tsconfig.e2e.json",
        "exclude": [
          "**/node_modules/**"
        ]
      }
    }
  }
 }
 },
 "defaultProject": "incident-management"
}
tsconfig.json

{
 "compileOnSave": false,
  "compilerOptions": {
   "baseUrl": "./",
   "outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"module": "es2015",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
  "node_modules/@types"
],
"lib": [
  "es2017",
  "dom"
]
} }


/portalName/应该是您的主机应用程序名

此信息不足以帮助您。您需要根据您的版本显示.angular-cli.json或.angular.json文件。您确定它没有创建
dist
文件夹吗?没有错误,所以它没有丢失的理由。@user184994谢谢,如果有错误它不会创建,是吗?@cenk ebret谢谢,我已经用文件更新了我的问题,您从哪个路径运行这个命令。angular.json中没有错误。我用我的替换了提供的angular.json。并检查。删除
“样式”:[“节点\模块/@clr/icons/clr icons.min.css”,“节点\模块/@clr/ui/clr ui.min.css”,“src/styles.css”],“脚本”:[“节点\模块/@webcomponents/custom elements/custom elements.min.js”,“节点\模块/@clr/icons/clr icons.min.js”]
构建工作正常。在dist/incident management中,hi是否有必要给出--base href/portalName/,因为angular.io文档并没有这样说。。我要做的是复制dist文件夹并将其保存在服务器上,然后在可能的情况下运行ng serve?@vinaykhegde
ng serve
仅用于开发人员使用。构建应用程序后(使用
ng build
),将不再使用
ng service
。相反,您可以使用服务器的HTTP服务器(如Apache或Nginx)为其提供服务。-base href/portalName/意味着您实际上正在为该门户构建它,并且它还将为该门户创建一个dist
ng build --prod --base-href /portalName/