angular-cli: Beta.1 --prod build error TS5055: Cannot write file 'path' because it would overwrite input file.

- [x ] bug report -> please search issues before submitting
- [ ] feature request

Versions.

    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/
@angular/cli: 1.5.0-beta.1
node: 6.10.3
os: win32 x64
@angular/animations: 5.0.0-rc.2
@angular/cdk: 2.0.0-beta.12
@angular/common: 5.0.0-rc.2
@angular/compiler: 5.0.0-rc.2
@angular/compiler-cli: 5.0.0-rc.2
@angular/core: 5.0.0-rc.2
@angular/forms: 5.0.0-rc.2
@angular/http: 5.0.0-rc.2
@angular/material: 2.0.0-beta.12
@angular/platform-browser: 5.0.0-rc.2
@angular/platform-browser-dynamic: 5.0.0-rc.2
@angular/platform-server: 5.0.0-rc.2
@angular/router: 5.0.0-rc.2
@angular/cli: 1.5.0-beta.1
@angular/language-service: 5.0.0-rc.2
typescript: 2.5.3

Repro steps.

Angular Cli 1.5.0-beta.1 ng build --aot && ng build --prod ng build works fine Running the 1.4.7 gives no errors.

The log given by the failure.

> ng build --prod

Date: 2017-10-15T14:23:01.412Z
Hash: 733c77181e79f09e63b1
Time: 49654ms
chunk {0} styles.48dc33ba103b17efb308.bundle.css (styles) 563 kB {3} [initial] [rendered]
chunk {1} polyfills.3bc34265385d52184eab.bundle.js (polyfills) 86 bytes {3} [initial] [rendered]
chunk {2} main.e402deade8b026b7d50e.bundle.js (main) 84 bytes [initial] [rendered]
chunk {3} inline.c4a92da1d0d88e20b804.bundle.js (inline) 1.45 kB [entry] [rendered]

ERROR in error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/es6/reflect.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/es7/reflect.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_a-function.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_an-instance.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_an-object.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_array-from-iterable.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_array-includes.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_array-methods.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_array-species-constructor.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_array-species-create.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_bind.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_classof.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_cof.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_collection-strong.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_collection-weak.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_collection.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_core.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_ctx.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_defined.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_descriptors.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_dom-create.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_enum-bug-keys.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_export.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_fails.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_for-of.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_global.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_has.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_hide.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_html.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_ie8-dom-define.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_inherit-if-required.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_invoke.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_iobject.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_is-array-iter.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_is-array.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_is-object.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_iter-call.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_iter-create.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_iter-define.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_iter-detect.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_iter-step.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_iterators.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_library.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_meta.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_metadata.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_object-assign.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_object-create.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_object-dp.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_object-dps.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_object-gopd.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_object-gopn.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_object-gops.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_object-gpo.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_object-keys-internal.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_object-keys.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_object-pie.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_own-keys.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_property-desc.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_redefine-all.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_redefine.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_set-proto.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_set-species.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_set-to-string-tag.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_shared-key.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_shared.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_to-absolute-index.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_to-integer.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_to-iobject.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_to-length.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_to-object.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_to-primitive.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_uid.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_validate-collection.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/_wks.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/core.get-iterator-method.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/es6.map.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/es6.reflect.apply.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/es6.reflect.construct.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/es6.reflect.define-property.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/es6.reflect.delete-property.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/es6.reflect.enumerate.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/es6.reflect.get-own-property-descriptor.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/es6.reflect.get-prototype-of.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/es6.reflect.get.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/es6.reflect.has.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/es6.reflect.is-extensible.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/es6.reflect.own-keys.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/es6.reflect.prevent-extensions.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/es6.reflect.set-prototype-of.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/es6.reflect.set.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/es6.set.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/es6.weak-map.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/es7.reflect.define-metadata.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/es7.reflect.delete-metadata.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/es7.reflect.get-metadata-keys.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/es7.reflect.get-metadata.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/es7.reflect.get-own-metadata-keys.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/es7.reflect.get-own-metadata.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/es7.reflect.has-metadata.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/es7.reflect.has-own-metadata.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/core-js/modules/es7.reflect.metadata.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/util/node_modules/inherits/inherits.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/util/support/isBuffer.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/util/util.js' because it would overwrite input file.
error TS5055: Cannot write file 'C:/proj/proj/node_modules/zone.js/dist/zone.js' because it would overwrite input file.


npm ERR! Windows_NT 10.0.15063
npm ERR! argv "C:\\NodeJS\\node.exe" "C:\\NodeJS\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
npm ERR! node v6.10.3
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! proj@3.0.0 prebuild: `ng build --prod`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the proj@3.0.0 prebuild script 'ng build --prod'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the proj package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ng build --prod
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs proj
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls proj
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\proj\proj\npm-debug.log

Package.json file dependecies and dev dependencies

"dependencies": {
    "@agm/core": "^1.0.0-beta.1",
    "@angular/animations": "^5.0.0-rc.2",
    "@angular/cdk": "^2.0.0-beta.8",
    "@angular/common": "^5.0.0-rc.2",
    "@angular/compiler": "^5.0.0-rc.2",
    "@angular/compiler-cli": "^5.0.0-rc.2",
    "@angular/core": "^5.0.0-rc.2",
    "@angular/forms": "^5.0.0-rc.2",
    "@angular/http": "^5.0.0-rc.2",
    "@angular/material": "^2.0.0-beta.8",
    "@angular/platform-browser": "^5.0.0-rc.2",
    "@angular/platform-browser-dynamic": "^5.0.0-rc.2",
    "@angular/platform-server": "^5.0.0-rc.2",
    "@angular/router": "^5.0.0-rc.2",
    "@nguniversal/express-engine": "^5.0.0-beta.1",
    "@nguniversal/module-map-ngfactory-loader": "^5.0.0-beta.1",
    "aws-sdk": "^2.90.0",
    "bcrypt-nodejs": "0.0.3",
    "body-parser": "^1.17.2",
    "chart.js": "^2.5.0",
    "compression": "^1.7.0",
    "connect-flash": "^0.1.1",
    "connect-gzip-static": "^2.0.1",
    "connect-redis": "^3.3.0",
    "core-js": "^2.5.1",
    "cron": "^1.2.1",
    "ejs": "^2.5.6",
    "email-templates": "^2.6.0",
    "enum": "^2.4.0",
    "express": "^4.15.3",
    "express-session": "^1.15.4",
    "font-awesome": "^4.7.0",
    "geo-tz": "^3.3.3",
    "hammerjs": "^2.0.8",
    "html": "^1.0.0",
    "html-pdf": "^2.1.0",
    "jimp": "^0.2.28",
    "moment": "^2.18.1",
    "mongoose": "^4.11.4",
    "mongoose-auto-increment": "^5.0.1",
    "mongoose-history": "^0.4.2",
    "morgan": "^1.8.2",
    "multer": "^1.3.0",
    "ngx-cookie": "^1.0.0",
    "ngx-quill": "^1.3.5",
    "nodemailer": "^4.0.1",
    "nodemailer-sendgrid-transport": "^0.2.0",
    "owasp-password-strength-test": "^1.3.0",
    "passport": "^0.3.2",
    "passport-local-mongoose": "^4.0.0",
    "pathinfo": "^0.1.0",
    "rand-token": "^0.3.0",
    "reflect-metadata": "^0.1.10",
    "rxjs": "^5.4.2",
    "sanitize-html": "^1.14.1",
    "serve-favicon": "^2.4.3",
    "socket.io": "^2.0.3",
    "stripe": "^4.23.1",
    "transliteration": "^1.6.2",
    "v8-profiler": "^5.7.0",
    "validator": "^8.0.0",
    "x-frame-options": "^1.0.0",
    "zone.js": "^0.8.14"
  },
  "devDependencies": {
    "@angular/cli": "1.5.0-beta.1",
    "@angular/language-service": "^5.0.0-rc.2",
    "@types/jasmine": "~2.5.53",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "angular2-template-loader": "^0.6.2",
    "codelyzer": "~3.1.1",
    "jasmine-core": "~2.6.2",
    "jasmine-spec-reporter": "~4.1.0",
    "karma": "~1.7.0",
    "karma-chrome-launcher": "~2.1.1",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "nodemon": "^1.11.0",
    "protractor": "~5.1.2",
    "ts-loader": "^2.3.2",
    "ts-node": "~3.2.0",
    "tslint": "~5.3.2",
    "typescript": "^2.5.3",
    "webpack-node-externals": "^1.6.0"
  }

Mention any other details that might be useful.

This bug popped up after updating to beta.1. Also tried the latest build rc.0 but no luck. Building with 1.4.7 gives no errors

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 15 (4 by maintainers)

Most upvoted comments

I have the same error when switching from AotPlugin to AngularCompilerPlugin in a custom webpack build with 5.0.0-rc.2. Seems to be caused by allowJS: true in tsconfig.

package.json

{
  "name": "acp-jserrors",
  "devDependencies": {
    "@angular/compiler-cli": "5.0.0-rc.2",
    "@angular/language-service": "5.0.0-rc.2",
    "@ngtools/webpack": "1.8.0-rc.0",
    "typescript": "2.5",
    "webpack": "3.6"
  },
  "dependencies": {
    "@angular/compiler": "5.0.0-rc.2",
    "@angular/core": "5.0.0-rc.2",
    "core-js": "2.5.1",
    "rxjs": "^5.4.3"
  }
}

tsconfig.json

{
    "compilerOptions": {
        "target": "es5",
        "module": "esnext",
        "moduleResolution": "node",
        "lib": ["dom", "es2015"],
        "allowJs": true,
        "experimentalDecorators": true,
        "outDir": "target/tsc",
        "baseUrl": "/"
    },
    "angularCompilerOptions": {
        "entryModule": "./app#AppModule",
        "genDir": "target/aot",
        "basePath": "/"
    },
    "include": ["*.ts"],
    "exclude": [
        "node_modules",
        "target"
    ]
}

webpack.config.js

const webpack = require("webpack");
const path = require("path");
const { AngularCompilerPlugin } = require("@ngtools/webpack");

module.exports = {
    context: __dirname,
    entry: {
        main: "./app"
    },
    output: {
        path: path.join(__dirname, "target"),
        filename: "out.js"
    },
    module: {
        rules: [{
            test: /\.ts$/,
            loader: "@ngtools/webpack"
        }]
    },
    plugins: [
        new AngularCompilerPlugin({
            tsConfigPath: path.join(__dirname, "tsconfig.json")
        })
    ]
};

app.ts

import {NgModule} from "@angular/core";
import "core-js/es6/array";

@NgModule({})
export class AppModule {}

@shobeck This should be corrected in 1.6.8. As this issue originally references an older beta version, if you are still experiencing this issue with 1.6.8, please open a new issue describing the conditions that exhibit the problem.

[waiting in anticipation…]