valor-software / ng2-select

Angular based replacement for select boxes
http://valor-software.github.io/ng2-select/
MIT License
675 stars 585 forks source link

Allow ng2-select to work with ng4 #738

Closed mircowidmer closed 4 months ago

mircowidmer commented 7 years ago

When I try to npm install an ng4 project (4.0.0) that is using ng2-select, I get the following warning:

ng2-select@1.2.0 requires a peer of @angular/common@^2.3.0 but none was installed.
ng2-select@1.2.0 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.

mouradhamoud commented 7 years ago

npm shrinkwrap will fail too

ahmadyaqob commented 7 years ago

─ UNMET PEER DEPENDENCY @angular/common@4.0.1 invalid ├── UNMET PEER DEPENDENCY @angular/core@4.0.1 invalid Same issue here!i've switched to angular the dependencies to version "2.." but still have the same issue

Scipionh commented 7 years ago

I am afraid this may never be done, but that's a must if this library is to last a bit longer

nomanbiniqbal commented 7 years ago

any news

Scipionh commented 7 years ago

This lib is dead, let's move on.

roolebo commented 7 years ago

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

roolebo commented 7 years ago

Ohh. It seems that the fork should also be rebuilt

roolebo commented 7 years ago

UPD: npm install --save ng2-select-compat installs exact copy of ng2-select@1.2.0 with relaxed dependencies It can be used as drop-in replacement of ng2-select:

import { SelectModule } from 'ng2-select-compat'
bymeftun commented 7 years ago

https://github.com/CuppaLabs/angular2-multiselect-dropdown

mouradhamoud commented 7 years ago

Using npm version 5 solved the version locking issue. The new npm generates a package-lock.json file so no more npm shrinkwrap !

samuelkavin commented 7 years ago

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",

filipefreitas82 commented 7 years ago

@mouradhamoud I'm using npm 5 and still get the same problem. How does it work for you?

mouradhamoud commented 7 years ago

@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.

filipefreitas82 commented 7 years ago

@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:

ng2-select@1.2.0 requires a peer of @angular/common@^2.3.0 but none was installed. ng2-select@1.2.0 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=" },

mouradhamoud commented 7 years ago

@filipefreitas82 Nice, I have the warnings too but this doesn't prevent the generation of the lock file.

chan71 commented 7 years ago

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.

optimistex commented 6 years ago

New life of the component in the fork: https://github.com/optimistex/ng2-select-ex And currently, it is supported with Angular 5