Error with Angular 4 ngc compiler
See original GitHub issueWhen trying to compile my project which uses this lib with ngc
compiler for AOT the following error in thrown:
Error: ENOENT: no such file or directory, open '/Users/jiayi/Desktop/Repo/angular-ui/dist/node_modules/angular2-notifications/src/notification.type.metadata.json'
at Error (native)
at Object.fs.openSync (fs.js:640:18)
at Object.fs.writeFileSync (fs.js:1333:33)
at MetadataWriterHost.writeMetadata (/Users/jiayi/Desktop/Repo/angular-ui/node_modules/@angular/tsc-wrapped/src/compiler_host.js:115:22)
at MetadataWriterHost._this.writeFile (/Users/jiayi/Desktop/Repo/angular-ui/node_modules/@angular/tsc-wrapped/src/compiler_host.js:92:23)
at Object.writeFile (/Users/jiayi/Desktop/Repo/angular-ui/node_modules/typescript/lib/typescript.js:64240:132)
at Object.writeFile (/Users/jiayi/Desktop/Repo/angular-ui/node_modules/typescript/lib/typescript.js:9020:14)
at printSourceFileOrBundle (/Users/jiayi/Desktop/Repo/angular-ui/node_modules/typescript/lib/typescript.js:61204:16)
at emitSourceFileOrBundle (/Users/jiayi/Desktop/Repo/angular-ui/node_modules/typescript/lib/typescript.js:61155:21)
at Object.forEachEmittedFile (/Users/jiayi/Desktop/Repo/angular-ui/node_modules/typescript/lib/typescript.js:8986:17)
I’ve already checked this errors appears only with Angular 4 migration. If I go back to 2.4.8
everything is fine.
Personally I’ve seen that notification.type.metadata.json
is missing in the package under node_modules
, but honestly I can’t understand why ngc
requires a metadata since it’s just an interface without any Angular specific code.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
cannot find module '@angular/compiler-cli/ngc' when I run ng ...
I had same problem. It's because angular-cli version is greater than angular version and compiler-cli is not compatible.
Read more >Angular compiler options
The ngc command is just a wrapper around TypeScript's tsc compiler command and is primarily configured via the tsconfig.json configuration options documented in ......
Read more >Deprecated APIs and features - Angular
Angular strives to balance innovation and stability. Sometimes, APIs and features become obsolete and need to be removed or replaced so that Angular...
Read more >How the Angular Compiler Works
The Angular Compiler (which we call ngc) is the tool used to compile Angular applications and libraries. ngc is built on the TypeScript ......
Read more >Ahead-of-time (AOT) compilation - Angular
There's no need to download the Angular compiler if the application is already compiled. The compiler is roughly half of Angular itself, so...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just updated the library to ng4, let me know if you are still getting this error, thanks 👍
Still facing this problem using ngc. My package.json dependencies are these:
"dependencies": { "@angular/animations": "4.4.0-RC.0", "@angular/common": "4.4.0-RC.0", "@angular/compiler": "4.4.0-RC.0", "@angular/compiler-cli": "4.4.0-RC.0", "@angular/core": "4.4.0-RC.0", "@angular/forms": "4.4.0-RC.0", "@angular/http": "4.4.0-RC.0", "@angular/platform-browser": "4.4.0-RC.0", "@angular/platform-browser-dynamic": "4.4.0-RC.0", "@ionic-native/core": "4.2.1", "@ionic-native/device": "4.2.1", "@ionic-native/push": "4.2.1", "@ionic-native/local-notifications": "4.2.1", "angular2-notifications": "^0.7.7", "angular2-logger": "^0.6.0", "ionic-angular": "3.6.0", "moment": "2.18.1", "rxjs": "5.4.3", "socket.io-client": "2.0.3", "zone.js": "0.8.17" }
Any solution?