angular: AoT Compiler does not work on Windows
I’m submitting a … (check one with “x”)
[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior
On Windows, the ngc compiler does not emit .ngfactory.ts file, instead, it emits .js, .js.map and .metadata.json files. On Ubuntu, it works as expected.
Expected/desired behavior
ngc should produce .ngfactory.ts file.
Please tell us about your environment: Windows 10 Professional, NodeJS v6.3.1 and v6.2.0
- Angular version: 2.0.0-rc.5
- Language: TypeScript@next
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 19
- Comments: 46 (4 by maintainers)
Links to this issue
Commits related to this issue
- fix(compiler-cli): make ngc to work on Windows Fixes #10792 — committed to marclaval/angular by marclaval 8 years ago
- fix(compiler-cli): make ngc to work on Windows Fixes #10792 — committed to marclaval/angular by marclaval 8 years ago
- fix(compiler-cli): make ngc to work on Windows Fixes #10792 — committed to marclaval/angular by marclaval 8 years ago
- fix(compiler-cli): make ngc to work on Windows Fixes #10792 — committed to marclaval/angular by marclaval 8 years ago
- fix(compiler-cli): make ngc to work on Windows Fixes #10792 — committed to marclaval/angular by marclaval 8 years ago
- fix(compiler-cli): make ngc to work on Windows (#10919) Fixes #10792 — committed to angular/angular by marclaval 8 years ago
I have the same problem
I had a same problem and solved it. So I share this.
check version of your compiler-cli & compiler
if compiler-cli got different version, install again with specific version
npm install @angular/compiler-cli@{your compiler version}I think somethimes ‘@angular\compiler-cli’ installed not properly with other version. (now Im using version 2.2.2)
Likewise here.
ngc generate js files what I don’t want.
ngc 0.6.0@windows 7
.\node_modules\.bin\ngc -p tsconfig.aot.jsonexample: app.module.ts
app.module.ts => app.module.js app.module.ngfactory.ts app.module.ngfactory.js
I only want app.module.ngfactory.ts, but lots of js files also generated. When run
webpackat next stage, webpack(ts-loader + another tsconfig.json) will choose js file first (not ts). Because of"module": "es2015"setting in tsconfig.aot.json, webpack not recognize ES2015importsyntax in generated js files.How could I generate ngfactory.ts file only?
@gdyrrahitis upgrade
@angular/compiler-clito0.6.0@AAAnderson7301, to run
ngcon the command prompt, put"around the path, like this:PS. Will take a look on RC.6 asap
The fix for this issue (#10919) has been merged into the master branch. So I think it’s gonna be fixed in RC6.
As a workaround for Windows 10 users, you can use node inside LXSS (more commonly Bash on Ubuntu on Windows) and the codegen seems to work correctly.