When I try to npm install an ng4 project (4.0.0) that is using ng2-select, I get the following warning:
[email protected] requires a peer of @angular/common@^2.3.0 but none was installed.
[email protected] requires a peer of @angular/core@^2.3.0 but none was installed.
I believe that is because the peer dependencies of version 1.2.0 of ng2-select are locked to 2.x.x, see package.json:
"peerDependencies": {
"@angular/common": "^2.3.0",
"@angular/core": "^2.3.0"
},
It should also allow to be usable with ng4 without producing warnings during npm install.
npm shrinkwrap will fail too
─ UNMET PEER DEPENDENCY @angular/[email protected] invalid
├── UNMET PEER DEPENDENCY @angular/[email protected] invalid
Same issue here!i've switched to angular the dependencies to version "2.." but still have the same issue
I am afraid this may never be done, but that's a must if this library is to last a bit longer
any news
This lib is dead, let's move on.
A forked version with relaxed dependencies can be used for now:
npm install --save https://github.com/roolebo/ng2-select/tarball/0e798ad4f04a0efccd03a757e3cc587e84906f46
It can be installed on angular 4.x
Ohh. It seems that the fork should also be rebuilt
UPD: npm install --save ng2-select-compat installs exact copy of [email protected] with relaxed dependencies
It can be used as drop-in replacement of ng2-select:
import { SelectModule } from 'ng2-select-compat'
Using npm version 5 solved the version locking issue. The new npm generates a package-lock.json file so no more npm shrinkwrap !
I still have sasme error even using ng2-select-compat. Any solution?
Here is my package.json
"@angular-generic-table/core": "^4.4.1",
"@angular/animations": "^4.3.4",
"@angular/common": "^4.0.0",
"@angular/compiler": "^4.0.0",
"@angular/core": "^4.0.0",
"@angular/forms": "^4.0.0",
"@angular/http": "^4.0.0",
@mouradhamoud I'm using npm 5 and still get the same problem. How does it work for you?
@filipefreitas82 I have the line "ng2-select": "1.2.0" in my package.json file.
The generated package-lock.json contains:
"ng2-select": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/ng2-select/-/ng2-select-1.2.0.tgz",
"integrity": "sha1-XJBhi/++MqzF7hwSjIhUcFm08Rw="
},
I didn't need to do anything special.
Extra details: I'm using npm v 5.3.0 and angular v 4.3.2, I hope this will help.
@mouradhamoud thanks. As it turns out my problem was related to other packages (ngx-bootstrap and ngx-uploader).
Still I'm using npm 5.3.0 with angular 4.3.6 and I'm getting the same warnings:
[email protected] requires a peer of @angular/common@^2.3.0 but none was installed.
[email protected] requires a peer of @angular/core@^2.3.0 but none was installed.
My package-lock.json also has the same as yours:
"ng2-select": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/ng2-select/-/ng2-select-1.2.0.tgz",
"integrity": "sha1-XJBhi/++MqzF7hwSjIhUcFm08Rw="
},
@filipefreitas82 Nice, I have the warnings too but this doesn't prevent the generation of the lock file.
Is ng2-select 1.2.0 going to support angular 4 at some point? I'm getting the warning as stated here with node 8.1.2 and @angular/cli: 1.3.2 and angular 4.2.4.
New life of the component in the fork: https://github.com/optimistex/ng2-select-ex
And currently, it is supported with Angular 5
Most helpful comment
UPD:
npm install --save ng2-select-compatinstalls exact copy of[email protected]with relaxed dependenciesIt can be used as drop-in replacement of ng2-select: