Ionic 2 : Warn after "npm install" - node.js

I use Ionic v2.1.8 and when I run the command "npm install" I have a lot of warn like this :
C:\xampp\htdocs\AppFineMobile>npm install
npm WARN #angular/compiler#2.4.8 requires a peer of #angular/core#2.4.8 but none was installed.
npm WARN #angular/compiler-cli#2.4.8 requires a peer of #angular/core#2.4.8 but none was installed.
npm WARN #angular/forms#2.4.8 requires a peer of #angular/core#2.4.8 but none was installed.
npm WARN #angular/forms#2.4.8 requires a peer of #angular/common#2.4.8 but none was installed.
npm WARN #angular/http#2.4.8 requires a peer of #angular/core#2.4.8 but none was installed.
npm WARN #angular/http#2.4.8 requires a peer of #angular/platform-browser#2.4.8 but none was installed.
npm WARN #angular/platform-browser-dynamic#2.4.8 requires a peer of #angular/core#2.4.8 but none was installed.
npm WARN #angular/platform-browser-dynamic#2.4.8 requires a peer of #angular/common#2.4.8 but none was installed.
npm WARN #angular/platform-browser-dynamic#2.4.8 requires a peer of #angular/platform-browser#2.4.8 but none was installed.
npm WARN #angular/platform-server#2.4.8 requires a peer of #angular/core#2.4.8 but none was installed.
npm WARN #angular/platform-server#2.4.8 requires a peer of #angular/common#2.4.8 but none was installed.
npm WARN #angular/platform-server#2.4.8 requires a peer of #angular/platform-browser#2.4.8 but none was installed.
npm WARN ionic-angular#2.2.0 requires a peer of #angular/common#2.4.8 but none was installed.
npm WARN ionic-angular#2.2.0 requires a peer of #angular/core#2.4.8 but none was installed.
npm WARN ionic-angular#2.2.0 requires a peer of #angular/platform-browser#2.4.8 but none was installed.
npm WARN ionic-angular#2.2.0 requires a peer of rxjs#5.0.1 but none was installed.
npm WARN ionic-angular#2.2.0 requires a peer of zone.js#0.7.2 but none was installed.
My package.json file :
{
"name": "ionic-hello-world",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"test": "ng test"
},
"config": {
"ionic_copy": "./config/copy.config.js"
},
"dependencies": {
"#angular/common": "^2.4.0",
"#angular/compiler": "^2.4.0",
"#angular/compiler-cli": "^2.4.0",
"#angular/core": "^2.4.0",
"#angular/forms": "^2.4.0",
"#angular/http": "^2.4.0",
"#angular/platform-browser": "^2.4.0",
"#angular/platform-browser-dynamic": "^2.4.0",
"#angular/platform-server": "^2.4.0",
"#angular/router": "^3.4.0",
"#ionic/storage": "2.0.0",
"font-awesome": "^4.7.0",
"ionic-angular": "2.2.0",
"ionic-native": "2.4.1",
"ionicons": "3.0.0",
"rxjs": "^5.1.0",
"sw-toolbox": "3.4.0",
"zone.js": "^0.7.6"
},
"devDependencies": {
"#angular/cli": "^1.0.0",
"#ionic/app-scripts": "1.1.4",
"codecov": "^2.1.0",
"jasmine-core": "^2.5.2",
"karma": "^1.5.0",
"karma-chrome-launcher": "^2.0.0",
"karma-jasmine": "^1.1.0",
"karma-mocha-reporter": "^2.2.3",
"karma-remap-istanbul": "^0.6.0",
"typescript": "2.0.9"
},
"cordovaPlugins": [
"cordova-plugin-whitelist",
"cordova-plugin-console",
"cordova-plugin-statusbar",
"cordova-plugin-device",
"ionic-plugin-keyboard",
"cordova-plugin-splashscreen"
],
"cordovaPlatforms": [],
"description": "AppFineMobile: An Ionic project"
}
I don't understand because I have these modules on my node_modules folder. And when I tried to install one of them, I keep the warn with another npm install.
I really don't understand and I don't know how to solve that

You just need to update all your angular packages to 2.4.8.Also your ionic-angular package is 2.2.0.
Change:
"#angular/common": "^2.4.8",
"#angular/compiler": "^2.4.8",
"#angular/compiler-cli": "^2.4.8",
"#angular/core": "^2.4.8",
"#angular/forms": "^2.4.8",
"#angular/http": "^2.4.8",
"#angular/platform-browser": "^2.4.8",
"#angular/platform-browser-dynamic": "^2.4.8",
"#angular/platform-server": "^2.4.8",
Also
"rxjs": "^5.0.1",
"zone.js" :"0.7.2"
Clear your node_modules folder in case of issues and do:
npm install

Related

Could not resolve peer dependency between my Angular app and my custom Angular library

I have created this Angular library that I now want to use in my other Angular apps, but I seem to have trouble with my peer dependencies. I have tried fiddling around in my App's package.json, but couldn't seem to remove any of my errors.
What I have tried (in that order) :
Removing node_modules
ng update
npm update
npm audit --fix
npm i
Recreating a new test app all together
Here are the errors :
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: lib-test#0.0.0
npm ERR! Found: #angular/common#13.0.3
npm ERR! node_modules/#angular/common
npm ERR! #angular/common#"~13.0.0" from the root project
npm ERR! peer #angular/common#"^13.0.0 || ^14.0.0-0" from #angular/cdk#13.2.2
npm ERR! node_modules/#angular/cdk
npm ERR! #angular/cdk#"^13.2.0" from the root project
npm ERR! peer #angular/cdk#"^13.0.0" from #my-group/angular-lib#1.1.4
npm ERR! node_modules/#my-group/angular-lib
npm ERR! #my-group/angular-lib#"*" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer #angular/common#"^13.1.0" from #my-group/angular-lib#1.1.4
npm ERR! node_modules/#my-group/angular-lib
npm ERR! #my-group/angular-lib#"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
package.json (App)
{
"name": "lib-test",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
"private": true,
"dependencies": {
"#angular/animations": "~13.0.0",
"#angular/cdk": "^13.2.2",
"#angular/common": "~13.0.0",
"#angular/compiler": "~13.0.0",
"#angular/core": "~13.0.0",
"#angular/forms": "~13.0.0",
"#angular/material": "^13.2.2",
"#angular/platform-browser": "~13.0.0",
"#angular/platform-browser-dynamic": "~13.0.0",
"#angular/router": "~13.0.0",
"#cloud-republic/angular-lib": "^1.1.4",
"rxjs": "~7.4.0",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"#angular-devkit/build-angular": "~13.0.3",
"#angular/cli": "~13.0.3",
"#angular/compiler-cli": "~13.0.0",
"#types/jasmine": "~3.10.0",
"#types/node": "^12.11.1",
"jasmine-core": "~3.10.0",
"karma": "~6.3.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.0.3",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "~1.7.0",
"typescript": "~4.4.3"
}
}
package.json (Library)
{
"name": "#my-group/angular-lib",
"version": "1.0.6",
"publishConfig": {
"#my-group:registry": "https://gitlab.com/api/v4/projects/XXXXXX/packages/npm/"
},
"scripts": {
"build-lib": "ng build lib-angular",
"semantic-release": "semantic-release"
},
"peerDependencies": {
"#angular/cdk": "^13.0.0",
"#angular/common": "^13.1.0",
"#angular/core": "^13.1.0",
"#angular/material": "^13.2.0",
"ngx-bootstrap": "^8.0.0",
"rxjs": "~7.4.0"
},
"dependencies": {
"tslib": "^2.3.0"
},
"devDependencies": {
"#semantic-release/gitlab": "^7.0.4",
"semantic-release": "^19.0.2"
}
}
Thanks in advance
This is not the issue with peer dependencies. This is more to do with version conflict. I guess you are using npm >=7 that's why you are getting this error:-
As mentioned in the error log try the below command to fix the issue:-
npm install --legacy-peer-deps
The above solution will solve your problem. However, the main issue is with your library.
In your library package you are saying use the below package:-
"#angular/common": "^13.1.0"
However, in your application, you have installed the below version.
"#angular/common": "~13.0.0".
So your library package is greater than the one installed in the application.
Either install the same version in your application or downgrade the version in your library.
In this way, npm install command will work without any issue.

npm install doesn't install dependencies in Angular project

I have an Angular project. When I run npm install I see some errors and dependencies don't appear in node_modules folder. However, I think none of the errors explain the problem. I see some deprecation warnings and 404 for one dependency, but nothing more.
Here is my package.json:
{
"name": "my-project",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"#angular/animations": "~9.0.0",
"#angular/cdk": "^9.1.0",
"#angular/common": "~9.0.0",
"#angular/compiler": "~9.0.0",
"#angular/core": "~9.0.0",
"#angular/forms": "~9.0.0",
"#angular/material": "^9.1.0",
"#angular/platform-browser": "~9.0.0",
"#angular/platform-browser-dynamic": "~9.0.0",
"#angular/router": "~9.0.0",
"#css-pkg/circular-std": "^2.0.0",
"#fortawesome/fontawesome-free": "^5.12.1",
"#syncfusion/ej2-angular-calendars": "^18.1.44",
"#types/jquery": "^3.3.38",
"alertifyjs": "^1.13.1",
"angular-mat-datepicker": "0.0.2",
"angular-material": "^1.1.21",
"angularx-qrcode": "^2.1.1",
"bootstrap": "^4.4.1",
"jquery": "^3.4.1",
"material-steppers": "^2.0.0",
"popper.js": "^1.16.1",
"rxjs": "~6.5.4",
"tslib": "^1.10.0",
"zone.js": "~0.10.2"
},
"devDependencies": {
"#angular-devkit/build-angular": "^0.900.4",
"#angular/cli": "~9.0.1",
"#angular/compiler-cli": "~9.0.0",
"#angular/language-service": "~9.0.0",
"#types/jasmine": "~3.5.0",
"#types/jasminewd2": "~2.0.3",
"#types/node": "^12.11.1",
"codelyzer": "^5.1.2",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.3.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~2.1.0",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.2",
"protractor": "~5.4.3",
"ts-node": "~8.3.0",
"tslint": "~5.18.0",
"typescript": "~3.7.5"
}
}
And here is the log output:
npm WARN deprecated popper.js#1.16.1: You can find the new Popper v2 at #popperjs/core, this package is dedicated to the legacy v1
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/#css-pkg%2fcircular-std - Not found
npm ERR! 404
npm ERR! 404 '#css-pkg/circular-std#^2.0.0' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'traveler-frontend'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/mac/.npm/_logs/2020-06-16T20_33_51_531Z-debug.log
Remove "#css-pkg/circular-std": "^2.0.0", line. Because it's not found in the npm package registry. Try npm install again.
The error says #css-pkg/circular-std can't be found. That package may be removed from npm directory. While searching the package I couldn't find it in the directory.

NPM peer Dependencies

I'm at the moment upgrading from Angular 4 to Angular 5 and received some warnings after that, for example:
npm WARN #angular/compiler-cli#5.0.1 requires a peer of typescript#>=2.4.2 <2.5 but none is installed. You must install peer dependencies yourself.
npm WARN #covalent/core#1.0.0-beta.8-1 requires a peer of #angular/common#^4.4.3 but none is installed. You must install peer dependencies yourself.
npm WARN #covalent/core#1.0.0-beta.8-1 requires a peer of #angular/core#^4.4.3 but none is installed. You must install peer dependencies yourself.
npm WARN #covalent/core#1.0.0-beta.8-1 requires a peer of #angular/forms#^4.4.3 but none is installed. You must install peer dependencies yourself.
npm WARN #covalent/core#1.0.0-beta.8-1 requires a peer of #angular/http#^4.4.3 but none is installed. You must install peer dependencies yourself.
npm WARN #covalent/core#1.0.0-beta.8-1 requires a peer of #angular/router#^4.4.3 but none is installed. You must install peer dependencies yourself.
npm WARN #covalent/core#1.0.0-beta.8-1 requires a peer of #angular/cdk#^2.0.0-beta.12 but none is installed. You must install peer dependencies yourself.
npm WARN #covalent/core#1.0.0-beta.8-1 requires a peer of #angular/material#^2.0.0-beta.12 but none is installed. You must install peer dependencies yourself.
This is my package.json
{
"name": "myAngularProject",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"#angular/animations": "^5.0.0",
"#angular/cdk": "^5.0.0-rc0",
"#angular/common": "^5.0.0",
"#angular/compiler": "^5.0.0",
"#angular/core": "^5.0.0",
"#angular/forms": "^5.0.0",
"#angular/http": "^5.0.0",
"#angular/material": "^5.0.0-rc0",
"#angular/platform-browser": "^5.0.0",
"#angular/platform-browser-dynamic": "^5.0.0",
"#angular/router": "^5.0.0",
"#covalent/core": "^1.0.0-beta.8-1",
"#ng-dynamic-forms/core": "^1.4.34",
"#ng-dynamic-forms/ui-material": "^1.4.34",
"ag-grid": "^13.3.1",
"ag-grid-angular": "^13.3.0",
"angular-in-memory-web-api": "^0.3.2",
"core-js": "^2.5.1",
"ng2-dnd": "^4.2.0",
"rxjs": "^5.5.2",
"webpack": "^3.8.1",
"zone.js": "^0.8.18"
},
"devDependencies": {
"#angular/cli": "^1.5.0",
"#angular/compiler-cli": "^5.0.0",
"#types/jasmine": "2.5.38",
"#types/node": "^6.0.90",
"codelyzer": "~2.0.0",
"install-peers": "^1.0.2",
"jasmine-core": "~2.5.2",
"jasmine-spec-reporter": "~3.2.0",
"karma": "~1.4.1",
"karma-chrome-launcher": "~2.0.0",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^0.2.0",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.0",
"ts-node": "~2.0.0",
"tslint": "~4.5.0",
"typescript": "^2.3.4"
},
}
My question is now, how do I add those peer dependencies manually and where? I've searched for ways to add them automatically but they do not work.
NOTE:
You don't have to add any peer dependencies, yourself. The message is only displaying that you have unmet dependencies, and I believe you can continue using #covalent package unless something breaks as these are warnings.
This seems to be an issue with the package #covalent as it depends upon #angular4 and it's respective packages and appears to be incompatible . Since there are few breaking changes from angular4 and angular5. So this is an expected behavior.
You have two options now precisely:
Submit PR to the said repository, so you can get a fix asap.
Wait for #covalent to release an update for #angular5, and once the update is out, you can safely update both #angular4 itself and #covalent as well.

#ng-bootstrap/ng-bootstrap#1.0.0-beta.5 requires a peer of #angular/core#^4.0.3, i have angular core 5.0.0

I tried following an online tutorial from the following link :
Bootstrap in Angular
I get the following warnings when running
npm install --save #ng-bootstrap/ng-bootstrap :
npm WARN codelyzer#3.2.2 requires a peer of #angular/core#^2.3.1 || >=4.0.0-beta <5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN #ng-bootstrap/ng-bootstrap#1.0.0-beta.5 requires a peer of #angular/core#^4.0.3 but none is installed. You must install peer dependencies yourself.
npm WARN #ng-bootstrap/ng-bootstrap#1.0.0-beta.5 requires a peer of #angular/common#^4.0.3 but none is installed. You must install peer dependencies yourself.
Checking my package.json file these are the dependencies generated :
`"dependencies": {
"#angular/animations": "^5.0.0",
"#angular/common": "^5.0.0",
"#angular/compiler": "^5.0.0",
"#angular/core": "^5.0.0",
"#angular/forms": "^5.0.0",
"#angular/http": "^5.0.0",
"#angular/platform-browser": "^5.0.0",
"#angular/platform-browser-dynamic": "^5.0.0",
"#angular/router": "^5.0.0",
"#ng-bootstrap/ng-bootstrap": "^1.0.0-beta.5",
"core-js": "^2.4.1",
"rxjs": "^5.5.2",
"zone.js": "^0.8.14"
},
"devDependencies": {
"#angular/cli": "1.5.0",
"#angular/compiler-cli": "^5.0.0",
"#angular/language-service": "^5.0.0",
"#types/jasmine": "~2.5.53",
"#types/jasminewd2": "~2.0.2",
"#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.4.2"
}
I have Angular CLI 1.5.0
Node: 8.9.1
Os: win32 x64
angular : 5.0.0
How do I resolve this ? Do I change the dependencies versions ? Or is there another way?
If running npm install on the missing dependencies, the package.json file still has the same version values for #angular/core and others as I assume those are the latest
Use:
"#ng-bootstrap/ng-bootstrap": "^1.0.0-beta.7"
And then npm i. This should fix the unmeet dependencies.
See the latest release from their github

Update Angular2 to latest version

I am trying to update Angular2 to the latest version release candidate 4.
I have executed npm outdated and edited accordingly the package.json file.
Then I have executed npm update which failed. I haven't saved the error message. In the following I googled and tried several different npm commands. Unfortunately I cannot recall them.
The current status is, that npm update does not show anything; so seems to work.
The command npm start starts the server, but the browser console displays multiple errors. The first is:
http://localhost:3000/node_modules/#angular/platform-browser-dynamic/platform-browser-dynamic.umd.js Failed to load resource: the server responded with a status of 404 (Not Found)
Besides npm install shows the following warnings:
typings WARN deprecated 2016-06-02: "registry:dt/core-js#0.0.0+20160317120654" is deprecated (updated, replaced or removed)
typings WARN deprecated 2016-06-22: "registry:dt/node#4.0.0+20160509154515" is deprecated (updated, replaced or removed)
typings WARN deprecated 2016-06-22: "registry:dt/jasmine#2.2.0+20160505161446" is deprecated (updated, replaced or removed)
├── core-js (global)
├── jasmine (global)
└── node (global)
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents#1.0.12
npm WARN optional Skipping failed optional dependency /lite-server/browser-sync/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents#1.0.12
npm WARN #angular/core#2.0.0-rc.4 requires a peer of rxjs#5.0.0-beta.6 but none was installed.
npm WARN #angular/http#2.0.0-rc.4 requires a peer of rxjs#5.0.0-beta.6 but none was installed.
npm WARN #angular/router#3.0.0-beta.2 requires a peer of rxjs#5.0.0-beta.6 but none was installed.
npm WARN #angular/router-deprecated#2.0.0-rc.1 requires a peer of #angular/core#2.0.0-rc.1 but none was installed.
npm WARN #angular/router-deprecated#2.0.0-rc.1 requires a peer of #angular/common#2.0.0-rc.1 but none was installed.
npm WARN #angular/router-deprecated#2.0.0-rc.1 requires a peer of #angular/platform-browser#2.0.0-rc.1 but none was installed.
npm WARN angular2-in-memory-web-api#0.0.14 requires a peer of rxjs#5.0.0-beta.6 but none was installed.
The package.json relevant parts are currently:
"dependencies": {
"#angular/common": "2.0.0-rc.4",
"#angular/compiler": "2.0.0-rc.4",
"#angular/core": "2.0.0-rc.4",
"#angular/http": "2.0.0-rc.4",
"#angular/platform-browser": "2.0.0-rc.4",
"#angular/platform-browser-dynamic": "2.0.0-rc.4",
"#angular/router": "3.0.0-beta.2",
"#angular/upgrade": "2.0.0-rc.4",
"angular2-in-memory-web-api": "0.0.14",
"angular2-uuid": "^1.0.7",
"bootstrap": "^3.3.6",
"core-js": "^2.4.0",
"reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.9",
"systemjs": "0.19.31",
"zone.js": "^0.6.12"
},
"devDependencies": {
"concurrently": "^2.0.0",
"lite-server": "^2.2.0",
"typescript": "^1.8.10",
"typings": "^1.0.4",
"canonical-path": "0.0.2",
"http-server": "^0.9.0",
"tslint": "^3.7.4",
"lodash": "^4.11.1",
"jasmine-core": "~2.4.1",
"karma": "^1.1.0",
"karma-chrome-launcher": "^1.0.1",
"karma-cli": "^1.0.1",
"karma-htmlfile-reporter": "^0.3.4",
"karma-jasmine": "^1.0.2",
"protractor": "^3.3.0",
"rimraf": "^2.5.2"
},
Follow these steps:
Delete node_modules folder.
Take latest package.json from https://angular.io/guide/quickstart
Run 'npm install' command.
In typings.json one must update to new registry value, if problem shows up for core-js
"core-js": "registry:dt/core-js#0.0.0+20160317120654"
to
"core-js": "registry:dt/core-js#0.0.0+20160725163759"
https://github.com/mgechev/angular2-seed/commit/8a8c64e0e8b18cd0c19c1ab2f1dc71a30bbd6174
This might be outdated but your typings were never addressed. Given that you would want to always keep them up to date. Also for anyone else seeking to know about the update process
Here is how you could update/reinstall them
Example:
For your node to update it simply type
typings install dt~node --save --global
The following will update your node typings which would be in /typings/global/node
If you did not have node the same command would suffice and your index.d.ts will also be update with a new entry!

Resources