Angular2: UNMET PEER DEPENDENCY rxjs#5.0.0-rc.4 - node.js

Could anybody tell me why npm is getting me this message when I perform npm install:
+-- #angular/common#2.2.4
+-- #angular/core#2.2.4
+-- #angular/http#2.2.4
+-- #angular/platform-browser#2.2.4
+-- #types/core-js#0.9.35
+-- UNMET PEER DEPENDENCY rxjs#5.0.0-rc.4
| `-- symbol-observable#1.0.4
`-- zone.js#0.6.26
What's UNMET PEER DEPENDENCY?
The content of packages.json is:
{
...
"dependencies": {
"#angular/common": "^2.2.4",
"#angular/core": "^2.2.4",
"#angular/http": "^2.2.4",
"#angular/platform-browser": "^2.2.4",
"rxjs": "^5.0.0-beta.12",
"zone.js": "^0.6.21"
}
}
Why npm is trying to resolve rxjs#5.0.0-rc.4 instead of rxjs#5.0.0-beta.12?

Here is a working package.json:
{
...
"dependencies": {
"#angular/common": "^2.2.4",
"#angular/core": "^2.2.4",
"#angular/http": "^2.2.4",
"#angular/platform-browser": "^2.2.4",
"rxjs": "5.0.0-beta.12",
"zone.js": "^0.6.21"
}
}
Just remove that ^

Related

Angular 9 upgrade peer dependency issue

When I try to upgrade angular using its documentation to version 9, I get following peer dependency error:
Package "#angular/compiler-cli" has a missing peer dependency of "tslib" # "^1.10.0".
Package "#angular/animations" has a missing peer dependency of "tslib" # "^1.10.0".
Package "#angular/common" has a missing peer dependency of "tslib" # "^1.10.0".
Package "#angular/compiler" has a missing peer dependency of "tslib" # "^1.10.0".
Package "codelyzer" has an incompatible peer dependency to "#angular/compiler" (requires ">=2.3.1 <8.0.0 || >7.0.0-beta <8.0.0" (extended), would install "9.1.13").
Package "#angular/core" has a missing peer dependency of "tslib" # "^1.10.0".
Package "codelyzer" has an incompatible peer dependency to "#angular/core" (requires ">=2.3.1 <8.0.0 || >7.0.0-beta <8.0.0" (extended), would install "9.1.13").
Package "#angular/forms" has a missing peer dependency of "tslib" # "^1.10.0".
Package "#angular/platform-browser" has a missing peer dependency of "tslib" # "^1.10.0".
Package "#angular/http" has an incompatible peer dependency to "#angular/platform-browser" (requires "7.2.16" (extended), would install "9.1.13").
Package "#angular/platform-browser-dynamic" has a missing peer dependency of "tslib" # "^1.10.0".
Package "#angular/router" has a missing peer dependency of "tslib" # "^1.10.0".
Here are the dependencies:
"dependencies": {
"#angular/animations": "^8.2.14",
"#angular/cdk": "^7.3.7",
"#angular/common": "^8.2.14",
"#angular/compiler": "^8.2.14",
"#angular/core": "^8.2.14",
"#angular/forms": "^8.2.14",
"#angular/http": "^7.2.16",
"#angular/material": "^7.3.7",
"#angular/platform-browser": "^8.2.14",
"#angular/platform-browser-dynamic": "^8.2.14",
"#angular/router": "^8.2.14",
"#types/underscore": "^1.8.8",
"ang-jsoneditor": "^1.6.2",
"core-js": "^2.4.1",
"cors": "^2.8.4",
"hammerjs": "^2.0.8",
"jsoneditor": "^5.24.7",
"jsoneditor2": "^1.0.0",
"lodash": "^4.17.20",
"moment": "^2.24.0",
"ng-multiselect-dropdown": "0.2.4",
"ngx-ace-wrapper": "^7.3.0",
"ngx-ui-loader": "^7.2.2",
"rxjs": "^6.6.3",
"rxjs-compat": "^6.6.3",
"underscore": "^1.9.1",
"zone.js": "^0.9.1"
},
"devDependencies": {
"#angular-devkit/build-angular": "^0.803.29",
"#angular/cli": "^8.3.29",
"#angular/compiler-cli": "^8.2.14",
"#angular/language-service": "^8.2.14",
"#compodoc/compodoc": "^1.1.11",
"#types/jasmine": "~2.8.3",
"#types/jasminewd2": "~2.0.2",
"#types/node": "~6.0.60",
"codelyzer": "^4.5.0",
"express": "^4.16.3",
"jasmine-core": "~2.8.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~2.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"mini-css-extract-plugin": "^0.8.0",
"protractor": "^5.3.2",
"ts-node": "~4.1.0",
"tslint": "~5.9.1",
"typescript": "^3.5.3"
}
Any suggestion?
The --force flag is the only thing that worked for me:
ng update --force #angular/core#9 #angular/cli#9
For me nothing worked. So I manually changed the version of tslib to the one it's complaining about... and it worked!

How to fix "publish-please can't be installed globally" error when I try `npm install firebase-tools -g`

I am facing an issue recently on my CI server. I always run npm install firebase-tools every time I would want to deploy my codes. However, recently this error prevents it from happenning.
Step to reproduce
cd to project folder
run npm install firebase-tools -g
output
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated cross-spawn-async#2.2.5: cross-spawn no longer requires a build toolchain, use it instead
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
> publish-please#5.5.2 preinstall C:\Users\ulala\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\publish-please
> node lib/pre-install.js
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! Starting from v2.0.0 publish-please can't be installed globally. !!
!! Use local installation instead : 'npm install --save-dev publish-please', !!
!! Or use npx if you do not want to install publish-please as a dependency. !!
!! (learn more: https://github.com/inikulin/publish-please#readme). !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#~2.1.2 (node_modules\firebase-tools\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! publish-please#5.5.2 preinstall: `node lib/pre-install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the publish-please#5.5.2 preinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Edit: here is my package.json. I don't install firebase-tools in my project.
package.json
{
"name": "app",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"test": "ng test",
"e2e": "ng e2e"
},
"husky": {
"hooks": {
"pre-commit": "npm run lint"
}
},
"private": true,
"dependencies": {
"#angular/animations": "~10.0.0",
"#angular/cdk": "^10.1.1",
"#angular/common": "~10.0.0",
"#angular/compiler": "~10.0.0",
"#angular/core": "~10.0.0",
"#angular/fire": "^6.0.2",
"#angular/flex-layout": "^10.0.0-beta.32",
"#angular/forms": "~10.0.0",
"#angular/material": "^10.0.0",
"#angular/platform-browser": "~10.0.0",
"#angular/platform-browser-dynamic": "~10.0.0",
"#angular/router": "~10.0.0",
"#ngrx/effects": "^10.0.0-beta.0",
"#ngrx/entity": "^10.0.0-beta.0",
"#ngrx/router-store": "^10.0.0-beta.0",
"#ngrx/store": "^10.0.0-beta.0",
"#ngrx/store-devtools": "^10.0.0-beta.0",
"#types/uuid": "^8.0.0",
"chart.js": "^2.9.3",
"compressorjs": "^1.0.6",
"emailjs-com": "^2.4.1",
"firebase": "^7.15.5",
"ng2-charts": "^2.4.1",
"rxjs": "~6.5.5",
"tslib": "^2.0.0",
"uuid": "^8.2.0",
"zone.js": "~0.10.3"
},
"devDependencies": {
"#angular-devkit/architect": ">= 0.900 < 0.1100",
"#angular-devkit/build-angular": "^0.1000.8",
"#angular/cli": "~10.0.0",
"#angular/compiler-cli": "~10.0.0",
"#types/jasmine": "~3.5.0",
"#types/jasminewd2": "~2.0.3",
"#types/node": "^12.11.1",
"codelyzer": "^6.0.0-next.1",
"firebase-tools": "^8.0.0",
"fuzzy": "^0.1.3",
"husky": "^4.2.5",
"inquirer": "^6.2.2",
"inquirer-autocomplete-prompt": "^1.0.1",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~5.0.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~3.3.0",
"karma-jasmine-html-reporter": "^1.5.0",
"open": "^7.0.3",
"prettier": "^2.0.5",
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"tslint-config-prettier": "^1.18.0",
"tslint-plugin-prettier": "^2.3.0",
"typescript": "~3.9.5"
},
"repository": {
"type": "git",
"url": "git+ssh://git#gitlab.com/skilio/client-web-app-2.0.git"
},
"author": "Dody",
"license": "ISC",
"bugs": {
"url": "https://gitlab.com/skilio/client-web-app-2.0/issues"
},
"homepage": "https://gitlab.com/skilio/client-web-app-2.0#readme"
}
As of about an hour ago (as of this writing) a fix has been published to the cli-table dependency of firebase-tools. If you try npm install -g firebase-tools now, it should work.
In other words, you weren't doing anything wrong. This was a temporary breakage in a dependency of firebase-tools that existed for a few hours.

Unmet peer dependency with ngx-webstorage but don't want to update to Angular 5.0.0

I'm trying to build a project that someone else has created but got the unmet dependency issue.
The NPM install command complains taht ngx-webstorage needs angular 5.0.0 and I indeed did not install 5.0.0 since the rest of the project cannot use that yet.
I globally installed node version 6.12 and have angular CLI version 3.10
$ which npm
/usr/bin/npm
$ npm --version
3.10.10
$ which ng
/usr/bin/ng
$ ng --version
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 1.6.2
Node: 6.12.0
OS: linux x64
Angular:
...
I used the globally installed npm to install the dependencies and then see the "requires a peer of " message.
$ npm install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN ngx-webstorage#2.0.1 requires a peer of #angular/core#^5.0.0 but none was installed.
npm WARN ng2-pop-over#0.9.37 requires a peer of #angular/core#^2.4.0 but none was installed.
npm WARN ng2-pop-over#0.9.37 requires a peer of zone.js#^0.7.2 but none was installed.
npm WARN ng2-accordion#0.0.15 requires a peer of #angular/core#^2.0.0 but none was installed.
npm WARN #schematics/angular#0.0.49 requires a peer of #angular-devkit/schematics#0.0.34 but none was installed.
Here's the package.json
{
"name": "perkin-elmer",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"prestart": "npm install",
"start": "ng serve --proxy-config proxy.config.json",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"#angular/animations": "^4.2.4",
"#angular/common": "^4.2.4",
"#angular/compiler": "^4.2.4",
"#angular/core": "^4.2.4",
"#angular/forms": "^4.2.4",
"#angular/http": "^4.2.4",
"#angular/platform-browser": "^4.2.4",
"#angular/platform-browser-dynamic": "^4.2.4",
"#angular/router": "^4.2.4",
"#types/underscore": "^1.8.6",
"ag-grid": "^13.3.1",
"ag-grid-angular": "^13.3.0",
"angular-2-dropdown-multiselect": "^1.6.3",
"angular2-multiselect-checkbox-dropdown": "^1.5.0",
"bootstrap": "^3.3.7",
"core-js": "^2.4.1",
"jquery": "^2.2.4",
"lodash": "^4.17.4",
"ng-dynamic-component": "^1.1.0",
"ng2-accordion": "0.0.15",
"ng2-bootstrap-modal": "^1.0.1",
"ng2-pop-over": "^0.9.37",
"ngx-treeview": "^1.2.5",
"ngx-webstorage": "^2.0.1",
"rxjs": "^5.4.2",
"underscore": "^1.8.3",
"zone.js": "^0.8.14"
},
"devDependencies": {
"#angular/cli": "1.4.5",
"#angular/compiler-cli": "^4.2.4",
"#angular/language-service": "^4.2.4",
"#types/jasmine": "~2.5.53",
"#types/jasminewd2": "~2.0.2",
"#types/lodash": "^4.14.91",
"#types/node": "~6.0.60",
"codelyzer": "~3.2.0",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~3.2.0",
"tslint": "~5.7.0",
"typescript": "~2.3.3"
}
}
Since I did not develop the package, I am not sure why the ngx-webstorage was set to require version 2.0.1, which needs angular 5.0.0 since that clearly does not correspond to the rest of the angular versions requirements since those are still 4 in all cases.
I checked the npm site for the requirements for ngx-webstorage 2.0.1 and indeed the devDependencies is 5.0.0, but how could this package.json ever have worked? I know it works, since the app is running on some other site...
Any help is appreciated.
Appearantly, ngx-webstorage is abandoned. ( See: https://github.com/PillowPillow/ng2-webstorage/pull/91)
Use Angular 6 compatible fork of ngx-webstorage: https://www.npmjs.com/package/#rars/ngx-webstorage/v/3.0.0
npm install #rars/ngx-webstorage --save

UNMET PEER DEPENDENCY D3.js and Angular 2

I have an existing Angular 2 project, and I'm trying to get started integrating some D3.js into my project. I'm new to Angular, and this will be my first go at using D3. I'll be following this tutorial: https://keathmilligan.net/create-reusable-chart-components-with-angular-2-and-d3-js-version-4/
I'm running the command npm install --save d3, and I get:
├── UNMET PEER DEPENDENCY #angular/compiler#2.2.3
├── UNMET PEER DEPENDENCY #angular/compiler-cli#2.2.3
├── UNMET PEER DEPENDENCY #angular/core#2.2.3
└── d3#4.4.1
...then
npm WARN #ngtools/webpack#1.2.1 requires a peer of #angular/compiler#^2.3.1 but none was installed.
npm WARN #ngtools/webpack#1.2.1 requires a peer of #angular/compiler-cli#^2.3.1 but none was installed.
npm WARN #ngtools/webpack#1.2.1 requires a peer of #angular/core#^2.3.1 but none was installed.
npm WARN #ngtools/webpack#1.2.1 requires a peer of #angular/tsc-wrapped#^0.5.0 but none was installed.
npm WARN tslint-loader#2.1.5 requires a peer of tslint#^3.0.0 but none was installed.
For one, I guess I'm still not exactly clear on what it really means when I see "UNMET PEER DEPENDENCY". Is this just a warning, or is this indicating that something is really broken? My project works currently (but I haven't started coding with D3)... Is it merely that the wrong version of something is installed? I've taken the steps of updating everything via npm update --save, and NPM did find some updates for me, but I still have the same issue.
My main question though, I'm installing D3js, shouldn't that be completely independent of Angular? Why is NPM barking about Angular stuff when I am installing something unrelated?
Here is my package.json post update:
"name": "cl-test2",
"version": "0.0.0",
"license": "MIT",
"angular-cli": {},
"scripts": {
"start": "ng serve",
"lint": "tslint \"src/**/*.ts\"",
"test": "ng test",
"pree2e": "webdriver-manager update",
"e2e": "protractor"
},
"private": true,
"dependencies": {
"#angular/common": "2.2.3",
"#angular/compiler": "2.2.3",
"#angular/core": "^2.2.3",
"#angular/forms": "2.2.3",
"#angular/http": "2.2.3",
"#angular/platform-browser": "2.2.3",
"#angular/platform-browser-dynamic": "2.2.3",
"#angular/router": "3.2.3",
"#types/node": "^6.0.58",
"angular-cli": "^1.0.0-beta.22-1",
"core-js": "^2.4.1",
"d3": "^4.4.1",
"rxjs": "5.0.0-beta.12",
"ts-helpers": "^1.1.1",
"tslint": "^4.3.1",
"zone.js": "^0.6.23"
},
"devDependencies": {
"#angular/compiler-cli": "2.2.3",
"#types/jasmine": "2.5.38",
"#types/node": "^6.0.42",
"angular-cli": "^1.0.0-beta.24",
"codelyzer": "~2.0.0-beta.1",
"jasmine-core": "2.5.2",
"jasmine-spec-reporter": "2.5.0",
"karma": "1.2.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.2.1",
"protractor": "4.0.9",
"ts-node": "1.2.1",
"tslint": "^4.0.2",
"typescript": "~2.0.3",
"webdriver-manager": "10.2.5"
}
}
UNMET PEER DEPENDENCY logs are just warnings not errors.
They warn you that the lib that you are using, #ngtools/webpack#1.2.1, should be using #angular/compiler#^2.3.1 (more info on ^ https://stackoverflow.com/a/22345808/5706293) as I'm sure you figured out yourself.
The author of those libs may have some deprecated APIs and may not support the current code in the later versions, that's one of the reasons that you should upgrade your dependencies.
This doesn't answer all of the questions I had, but it does clear up the warnings I was getting. I just updated several packages to the latest versions.
{
"name": "cl-test2",
"version": "0.0.0",
"license": "MIT",
"angular-cli": {},
"scripts": {
"start": "ng serve",
"lint": "tslint \"src/**/*.ts\"",
"test": "ng test",
"pree2e": "webdriver-manager update",
"e2e": "protractor"
},
"private": true,
"dependencies": {
"#angular/common": "^2.4.2",
"#angular/compiler": "^2.4.2",
"#angular/core": "^2.4.2",
"#angular/forms": "^2.4.2",
"#angular/http": "^2.4.2",
"#angular/platform-browser": "^2.4.2",
"#angular/platform-browser-dynamic": "^2.4.2",
"#angular/router": "^3.4.2",
"core-js": "^2.4.1",
"d3": "^4.4.1",
"rxjs": "^5.0.1",
"ts-helpers": "^1.1.2",
"types.d3": "^0.1.1",
"zone.js": "^0.7.2"
},
"devDependencies": {
"#angular/compiler-cli": "2.4.2",
"#types/jasmine": "2.5.38",
"#types/node": "^6.0.42",
"angular-cli": "^1.0.0-beta.24",
"codelyzer": "~2.0.0-beta.1",
"jasmine-core": "2.5.2",
"jasmine-spec-reporter": "2.5.0",
"karma": "1.2.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.2.1",
"protractor": "4.0.13",
"ts-node": "1.2.1",
"tslint": "^4.0.2",
"typescript": "~2.1.4",
"webdriver-manager": "10.2.5"
}
}
I had also similar issue, I have followed the steps
First, npm install -g #angular/cli
create new project with ng new hero-app
After the go inside the project folder and run server ng serve
and open browser and run http://localhost:4200
This is work for me.. Hope same thing work for you as well

angular2 2.0.0 UNMET PEER DEPENDENCY rxjs#5.0.0-beta.12, npm WARN angular2-jwt#0.1.22 requires a peer of rxjs#5.0.0-beta.11

this is dependencies from my package.json file:
"dependencies": {
"#angular/common": "2.0.0",
"#angular/compiler": "2.0.0",
"#angular/core": "2.0.0",
"#angular/forms": "2.0.0",
"#angular/http": "2.0.0",
"#angular/platform-browser": "2.0.0",
"#angular/platform-browser-dynamic": "2.0.0",
"#angular/router": "3.0.0",
"#angular/upgrade": "2.0.0",
"angular2-in-memory-web-api": "0.0.20",
"angular2-jwt": "^0.1.22",
"bootstrap": "^3.3.6",
"core-js": "^2.4.1",
"es6-promise": "^3.1.2",
"es6-shim": "^0.35.1",
"es7-reflect-metadata": "^1.6.0",
"jwt-decode": "^2.0.1",
"reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.12",
"systemjs": "0.19.27",
"zone.js": "^0.6.23"
},
I get warning of angular2-jwt dependency, but I need this pack.
And this is a warning message:
UNMET PEER DEPENDENCY rxjs#5.0.0-beta.12
npm WARN angular2-jwt#0.1.22 requires a peer of rxjs#5.0.0-beta.11
Any ideas?, Thanks.
Such a warning can be ignored. angular2-jwt just needs it peer dependencies updated to match the release version of angular2. Everything will work and is installed as expected
you need to tell at the sytemjs where is the angular2-jwt path so you need to include in the map object.
'angular2-jwt': 'npm:angular2-jwt/angular2-jwt.js'
Be sure, you have in package.json strings:
"devDependencies": {
....
},
"dependencies": {
....
"#types/systemjs": "^0.19.32",
"angular": "^1.5.0",
"angular-animate": "^1.5.0",
"angular-mocks": "^1.5.0",
"base64-js": "^1.2.0",
"bower": "^1.3.12",
....
}
Error: (SystemJS) XHR error (404 Not Found) loading http://localhost:3000/ng2-dropdown-treeview
or
+-- ng2-dropdown-treeview#0.1.4
+-- UNMET PEER DEPENDENCY rxjs#5.0.0-beta.12
`-- UNMET PEER DEPENDENCY zone.js#0.6.26
I have added the dependency in system.config.js file for ng2-dropdown-treeview, then it works for me.
'rxjs': 'npm:rxjs',
'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js',
'lodash': 'npm:lodash/lodash.min.js',
'ng2-dropdown-treeview': 'npm:ng2-dropdown-treeview/bundles/ng2-dropdown-treeview.umd.js',

Resources