ng2-file-upload
ng2-file-upload copied to clipboard
Update to angular 8
[email protected] requires a peer of @angular/common@^2.3.1 || >=4.0.0 but none is installed. You must install peer dependencies yourself
I guess you have this error when you do :
ng update @angular/cli @angular/core
I fixed it by forcing the update, and everything works fine :
ng update @angular/cli @angular/core --force
By the way, ng2-file-upload doesn't work anymore if you enable ivy, so I've forked the project and rebuilt it in an angular 8 library, now it works. Sorry, it's not documented but it was initially for my own usage (to test ivy in my apps).
I changed the prefix from ng2XXX to adXXX.
import { FileItem, FileUploader } from 'ad-file-upload';
...
<input type="file" adFileSelect [uploader]="uploader" multiple
...
https://www.npmjs.com/package/ad-file-upload
As pointed out by @adessilly, it has issues with Ivy too:
../node_modules/ng2-file-upload/file-upload/file-upload.module.d.ts:1:22 - error TS-996003: Appears in the NgModule.exports of xxxxModule, but could not be resolved to an
NgModule, Component, Directive, or Pipe class
The problem is similar to angular-froala-wysiwyg. Both ng2-file-uploader and angular-froala-wysiwyg use ngm
for building the project. For compatibility with Ivy, Angular CLI should better be used. In angular-froala-wysiwyg, someone already volunteered to perform the migration to Angular CLI: https://github.com/froala/angular-froala-wysiwyg/pull/329. The same steps can be applied to ng2-file-upload.
@jpike88 thanks for clarifying the reported issue