Upgrade from Angular 11 to 12 causes peer dependency conflict - node.js

I'm currently upgrading from Angular 11.2.14 to Angular 12.0.5 and I run into the following issue:
npm ERR! Could not resolve dependency:
npm ERR! dev #angular-devkit/build-angular#"12.0.5" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: #angular/compiler-cli#12.0.5
npm ERR! node_modules/#angular/compiler-cli
npm ERR! dev #angular/compiler-cli#"12.0.5" from the root project
npm ERR! peer #angular/compiler-cli#"^12.0.0" from #angular-devkit/build-angular#12.0.5
npm ERR! node_modules/#angular-devkit/build-angular
npm ERR! dev #angular-devkit/build-angular#"12.0.5" from the root project
npm ERR! 2 more (#angular/localize, ng-packagr)
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.
Am I right assuming this is because there is a conflict between the version 12.0.5 and 12.0.0 and they are incompatible? All my dependencies have now the same version, why is there a conflict present?
package.json
"#angular-builders/custom-webpack": "12.1.0",
"#angular-devkit/build-angular": "12.0.5",
"#angular/animations": "12.0.5",
"#angular/cdk": "12.0.5",
"#angular/cli": "12.0.5",
"#angular/common": "12.0.5",
"#angular/compiler": "12.0.5",
"#angular/compiler-cli": "12.0.5",
"#angular/core": "12.0.5",
"#angular/flex-layout": "11.0.0-beta.33",
"#angular/forms": "12.0.5",
"#angular/language-service": "12.0.5",
"#angular/material": "11.2.13",
"#angular/platform-browser": "12.0.5",
"#angular/platform-browser-dynamic": "12.0.5",
"#angular/router": "12.0.5",
Thanks a lot!

I had to use npm v6 to make a successful update:
npm -g i npm#^6
npm i
ng update #angular/cli#^12 #angular/core#^12

I had got same error on every version angular update when i used official update guide https://update.angular.io/ and command npx #angular/cli#12 update #angular/core#12 #angular/cli#12.
After long googling and trying i found next way for angular and angular material update (example for 10 to 11 update):
npx #angular/cli#11 update #angular/core#11 #angular/cli#11
getting subj error
remove node_modules and package-lock.json
npm install
Git commit
ng update #angular/core#11 --migrate-only --from 10 --to 11
Git commit
ng update #angular/cli#11 --migrate-only --from 10 --to 11
Git commit
npx #angular/cli#11 update #angular/material#11 #angular/flex-layout#11.0.0-beta.33

Downgrad npm v6, I tried bunch of commands after googling get successful now
npm -g i npm#^6
npm i
ng update #angular/cli#^12 #angular/core#^12

I had this same issue which was confusing as a beginner
I initially tried this command, but I just got another error
ng update #angular/cli #angular/core
I then found this link https://github.com/angular/angular-cli/issues/20843 and one person said to do this global cli command, this seemed to have fixed the issue when creating a new project
npm i #angular/cli -g
I can now create my new project command e.g.:
ng new example --routing false --style css --skip-git --skip-tests

Update your tsconfig.json and then run
sudo npm install --force

Related

Upgrading Angular solution from v11.0.5 to v15.0.5

TL;DR: What is the fastest way to upgrade a legacy Angular (eg v11) to the latest version (eg v15)?
I have an Angular 11 solution which has this packages.json file:
{
"name": "my-first-app",
"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": "^11.0.5",
"#angular/common": "^11.0.5",
"#angular/compiler": "^11.0.5",
"#angular/core": "^11.0.5",
"#angular/forms": "^11.0.5",
"#angular/platform-browser": "^11.0.5",
"#angular/platform-browser-dynamic": "^11.0.5",
"#angular/router": "^11.0.5",
"bootstrap": "3.3.7",
"rxjs": "^6.6.3",
"rxjs-compat": "^6.0.0",
"tslib": "^2.0.3",
"zone.js": "^0.10.3"
},
"devDependencies": {
"#angular-devkit/build-angular": "^0.1100.4",
"#angular/cli": "^11.0.4",
"#angular/compiler-cli": "^11.0.5",
"#types/jasmine": "~3.6.0",
"#types/jasminewd2": "~2.0.3",
"#types/node": "^12.19.9",
"codelyzer": "^6.0.1",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~5.1.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.0.3",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.4",
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "~4.0.2"
}
}
npm install in the solution folder produces this:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: my-first-app#0.0.0
npm ERR! Found: jasmine-core#3.6.0
npm ERR! node_modules/jasmine-core
npm ERR! dev jasmine-core#"~3.6.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer jasmine-core#">=3.8" from karma-jasmine-html-reporter#1.7.0
npm ERR! node_modules/karma-jasmine-html-reporter
npm ERR! dev karma-jasmine-html-reporter#"^1.5.4" 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.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! C:\Users\xxx\AppData\Local\npm-cache\_logs\2023-01-25T20_36_55_645Z-eresolve-report.txt
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\xxx\AppData\Local\npm-cache\_logs\2023-01-25T20_36_55_645Z-debug-0.log
I then run npm install --legacy-peer-deps, which produces a lot of WARN statements and then shows this:
added 1597 packages, and audited 1598 packages in 1m
118 packages are looking for funding
run `npm fund` for details
27 vulnerabilities (5 moderate, 21 high, 1 critical)
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
So, I run npm audit fix --force which produces this:
added 143 packages, removed 694 packages, changed 122 packages, and audited 1047 packages in 20s
86 packages are looking for funding
run `npm fund` for details
# npm audit report
minimatch <3.0.5
Severity: high
minimatch ReDoS vulnerability - https://github.com/advisories/GHSA-f8q6-p94x-37v3
fix available via `npm audit fix`
node_modules/minimatch
1 high severity vulnerability
To address all issues, run:
npm audit fix
So, I run npm audit fix --force again, and it shows this:
removed 1 package, changed 1 package, and audited 1046 packages in 3s
86 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
Now, if I run ng serve I get this:
Your global Angular CLI version (15.0.5) is greater than your local version (11.1.2). The local Angular CLI version is used.
To disable this warning use "ng config -g cli.warnings.versionMismatch false".
This version of CLI is only compatible with Angular versions ^15.0.0,
but Angular version 11.2.14 was found instead.
Please visit the link below to find instructions on how to update Angular.
https://update.angular.io/
I visit https://update.angular.io/ and select from v11 to v12, as it also states
You can't run ng update to update Angular applications more than one
major version at a time.
So, from https://update.angular.io/?v=11.0-12.0 I run ng update #angular/core#12 #angular/cli#12, which produces:
The installed Angular CLI version is outdated.
Installing a temporary Angular CLI versioned 12.2.18 to perform the update.
√ Packages successfully installed.
Using package manager: 'npm'
Collecting installed dependencies...
Found 31 dependencies.
Fetching dependency metadata from registry...
Package "#angular-devkit/build-angular" has an incompatible peer dependency to "#angular/compiler-cli" (requires "^15.0.0" (extended), would install "12.2.17").
Package "#angular-devkit/build-angular" has an incompatible peer dependency to "typescript" (requires ">=4.8.2 <5.0", would install "4.3.5").
× Migration failed: Incompatible peer dependencies found.
Peer dependency warnings when installing dependencies means that those dependencies might not work correctly together.
You can use the '--force' option to ignore incompatible peer dependencies and instead address these warnings later.
See "C:\Users\xxx\AppData\Local\Temp\ng-7soZ7i\angular-errors.log" for further details.
So I run ng update #angular/core#12 #angular/cli#12 --force which produces a lot of output, but appears to work.
Next, I moved to https://update.angular.io/?v=12.0-13.0 which states I should run ng update #angular/core#13 #angular/cli#13 and produces:
The installed Angular CLI version is outdated.
Installing a temporary Angular CLI versioned 13.3.10 to perform the update.
√ Packages successfully installed.
Using package manager: 'npm'
Collecting installed dependencies...
Found 31 dependencies.
Fetching dependency metadata from registry...
Package "#angular-devkit/build-angular" has an incompatible peer dependency to "#angular/compiler-cli" (requires "^15.0.0" (extended), would install "13.3.12").
Package "#angular-devkit/build-angular" has an incompatible peer dependency to "typescript" (requires ">=4.8.2 <5.0", would install "4.6.4").
× Migration failed: Incompatible peer dependencies found.
Peer dependency warnings when installing dependencies means that those dependencies might not work correctly together.
You can use the '--force' option to ignore incompatible peer dependencies and instead address these warnings later.
See "C:\Users\xxx\AppData\Local\Temp\ng-p47IAP\angular-errors.log" for further details.
So I run it like this: ng update #angular/core#13 #angular/cli#13 --force which also produces a lot of output but finally appears to complete successfully.
This moves me to https://update.angular.io/?v=13.0-14.0 which states I should run ng update #angular/core#14 #angular/cli#14. I see this:
The installed Angular CLI version is outdated.
Installing a temporary Angular CLI versioned 14.2.10 to perform the update.
√ Packages successfully installed.
Using package manager: npm
Collecting installed dependencies...
Found 31 dependencies.
Fetching dependency metadata from registry...
Package "#angular-devkit/build-angular" has an incompatible peer dependency to "#angular/compiler-cli" (requires "^15.0.0" (extended), would install "14.2.12").
× Migration failed: Incompatible peer dependencies found.
Peer dependency warnings when installing dependencies means that those dependencies might not work correctly together.
You can use the '--force' option to ignore incompatible peer dependencies and instead address these warnings later.
See "C:\Users\xxx\AppData\Local\Temp\ng-wQ5M5Z\angular-errors.log" for further details.
So I run ng update #angular/core#14 #angular/cli#14 --force which, again, appears to complete successfully.
This leads me to https://update.angular.io/?v=14.0-15.0 and running the command ng update #angular/core#15 #angular/cli#15 which appears to complete, as well - fortunately, this time, without the need for --force.
Running ng serve works.
Is this the best way to upgrade a legacy Angular project to the latest version?
Yes, the ng update command is the recommended path to update angular applications.
With the latest CLI Versions, you can update only one version at a time (in the past, you could bump two or more versions at once). The idea behind this is to be able to run all the needed migrations when updating to a newer version without the risk of conflicts. The CLI runs the migrations for you.
The errors you got, like:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: my-first-app#0.0.0
npm ERR! Found: jasmine-core#3.6.0
npm ERR! node_modules/jasmine-core
npm ERR! dev jasmine-core#"~3.6.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer jasmine-core#">=3.8" from karma-jasmine-html-reporter#1.7.0
npm ERR! node_modules/karma-jasmine-html-reporter
npm ERR! dev karma-jasmine-html-reporter#"^1.5.4" from the root project
Are not related to Angular, but to npm (I guess you are using npm 7+). Newer npm versions will check that peer dependencies versions are respected and throw an error in case of a wrong version (as you are getting). From npm 7 release docs:
npm 7 will block installations if an upstream dependency conflict is
present that cannot be automatically resolved.
You have the option to retry with --force to bypass the conflict or
--legacy-peer-deps command to ignore peer dependencies entirely (this behavior is similar to versions 4-6).
In general, I would advise avoiding using --force while updating your dependencies and trying to find the right combination of versions between the libraries.

Angular dependency issue Windows to Linux

I'm trying to host an Angular application for a customer, but I can't get it to run on Linux. The customer develops on Windows and it works for him. I am using NodeJS 19.
Error message when npm install:
npm notice
npm notice New minor version of npm available! 9.2.0 -> 9.3.1
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.3.1>
npm notice Run `npm install -g npm#9.3.1` to update!
npm notice
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: #agm/core#3.0.0-beta.0
npm ERR! Found: #angular/common#14.2.12
npm ERR! node_modules/#angular/common
npm ERR! #angular/common#"^14.2.0" from the root project
npm ERR! peer #angular/common#"^14.0.0 || ^15.0.0" from #angular/cdk#14.2.7
npm ERR! node_modules/#angular/cdk
npm ERR! #angular/cdk#"^14.2.4" from the root project
npm ERR! peer #angular/cdk#"14.2.7" from #angular/material#14.2.7
npm ERR! node_modules/#angular/material
npm ERR! #angular/material#"^14.2.4" from the root project
npm ERR! 1 more (#angular/material-moment-adapter)
npm ERR! 5 more (#angular/forms, #angular/material, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer #angular/common#"^9.1.0 || ^10.0.0" from #agm/core#3.0.0-beta.0
npm ERR! node_modules/#agm/core
npm ERR! #agm/core#"^3.0.0-beta.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: #angular/common#10.2.5
npm ERR! node_modules/#angular/common
npm ERR! peer #angular/common#"^9.1.0 || ^10.0.0" from #agm/core#3.0.0-beta.0
npm ERR! node_modules/#agm/core
npm ERR! #agm/core#"^3.0.0-beta.0" 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
{
"name": "web-app",
"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": {
"#agm/core": "^3.0.0-beta.0",
"#angular/animations": "^14.2.0",
"#angular/cdk": "^14.2.4",
"#angular/common": "^14.2.0",
"#angular/compiler": "^14.2.0",
"#angular/core": "^14.2.0",
"#angular/forms": "^14.2.10",
"#angular/material": "^14.2.4",
"#angular/material-moment-adapter": "^14.2.5",
"#angular/platform-browser": "^14.2.10",
"#angular/platform-browser-dynamic": "^14.2.0",
"#angular/router": "^14.2.10",
"#manekinekko/angular-web-bluetooth": "^11.2.2",
"#types/googlemaps": "^3.39.13",
"#types/maplibre-gl": "^1.14.0",
"#types/web-bluetooth": "^0.0.16",
"bootstrap": "^3.4.1",
"maplibre-gl": "^1.15.3",
"moment": "^2.29.4",
"rxjs": "~7.5.0",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"#angular-devkit/build-angular": "^14.2.2",
"#angular/cli": "~14.2.2",
"#angular/compiler-cli": "^14.2.0",
"#types/geojson": "^7946.0.10",
"#types/jasmine": "~4.0.0",
"jasmine-core": "~4.3.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.0.0",
"typescript": "~4.7.2"
}
}
I have already tried --force and --legacy-peer-deps but it still doesn't work.
A couple of things here.
First one of the packages you're using doesn't like the version of Angular you're using.
#agm/core#3.0.0-beta.0
This says that #agm/core#3.0.0-beta.0 is made for angular 9-10 and you're running 14.
npm ERR! Could not resolve dependency:
npm ERR! peer #angular/common#"^9.1.0 || ^10.0.0" from #agm/core#3.0.0-beta.0
npm ERR! node_modules/#agm/core
npm ERR! #agm/core#"^3.0.0-beta.0" from the root project
If you MUST use this version of #agm/core#3.0.0-beta.0 then you can run:
npm install --legacy-peer-deps
But this is not best practice. It's better to look for a version that works with your Angular version. A quick look at that package (npm view #agm/core versions --json) shows me that you have the latest version, since it's dependency is Angular 9-10 you might want to look for a replacement library that works with your version of Angular.
Second, you are using a development version of node, meaning that 19 is the latest but not considered stable by node.js- odd numbers for development, even numbers for production, current stable version is 18.13.0:
https://nodejs.org/en/download/
If you want to use multiple versions of node, you can use nvm (Node version manager)
Your version of node.js needs to match the installation version of node.js - so the Windows machine and the Linux machine need to both have the same version of node.js - that might be why it works in one place and not the other.

Npm Install is Failing (Could not resolve dependency)

When i try to do npm install i get the following:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: foliosure#1.0.1
npm ERR! Found: zone.js#0.8.29
npm ERR! node_modules/zone.js
npm ERR! zone.js#"~0.8.26" from the root project
npm ERR! peer zone.js#"~0.8.26" from #angular/core#7.2.16
npm ERR! node_modules/#angular/core
npm ERR! #angular/core#"~7.2.0" from the root project
npm ERR! peer #angular/core#"^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0" from primeng_latest#11.2.3
npm ERR! node_modules/primeng_latest
npm ERR! primeng_latest#"npm:primeng#^11.2.0" from the root project
npm ERR! 3 more (#angular/common, #angular/forms, #angular/platform-browser)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer zone.js#"^0.10.2" from primeng_latest#11.2.3
npm ERR! node_modules/primeng_latest
npm ERR! primeng_latest#"npm:primeng#^11.2.0" 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
This is my package.json dependencies file:
"dependencies":
"#angular/compiler": "~7.2.0",
"#angular/core": "~7.2.0",
"#angular/forms": "~7.2.0",
"#angular/http": "^7.2.4",
"#angular/material": "^7.3.7",
"#angular/router": "~7.2.0",
"#types/d3": "^5.7.2",
"bootstrap": "^4.4.1",
"codemirror": "^5.58.2",
"file-saver": "^2.0.0",
"font-awesome": "^4.7.0",
"highcharts": "^9.0.0",
"material-design-icons": "^3.0.1",
"moment": "^2.24.0",
"ngx-spinner": "^7.2.0",
"ngx-toastr": "^9.2.0",
"primeicons": "^1.0.0",
"primeng": "^7.0.5",
"primeng_latest": "npm:primeng#^11.2.0",
"rxjs": "~6.3.3",
"zone.js": "~0.8.26"
I tried downgrading the versions but it still gives the error. I also tried to google the solution but didn't find the right solution, would appreciate any help, Thank you.
Looks like it's a problem with Peer Dependencies try with npm install --legacy-peer-deps.
You can skip peer dependency conflict checks by running npm install --legacy-peer-deps or you can set npm config set legacy-peer-deps true and then run npm install once again.
If you want to run the angular code of your friend in your machine then follow the steps.
step 1: this can be happen due to version mismatch in your node version and your friends node version and npm version.
C://projectFolder> node --version
then
C://projectFolder> npm -v
step 2: If the version is mismatch then uninstall node in your machine then restart then install the node version of your friend.
step 3:
run the below code example
1.
npm install npm#[version]
in my machine
npm install -g npm#6.2.0
now run npm install in your project folder
npm install
now npm start or ng serve to work perfectly

Error when trying to install react-redux dependency

I am getting an error trying to install the react-redux package onto my create-react-app application. I have tried deleting and reinstalling my node_modules folder as well as installing it with admin permissions and I am still receiving the same error
➜ frontend git:(main) ✗ npm i react-redux
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
Here is the remaining output from the console
npm ERR!
npm ERR! While resolving: frontend#0.1.0
npm ERR! Found: react#17.0.1
npm ERR! node_modules/react
npm ERR! react#"^17.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16.8.3" from react-redux#7.2.1
npm ERR! node_modules/react-redux
npm ERR! react-redux#"*" 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.
Here is the list of current dependencies in my package.json
"dependencies": {
"#testing-library/jest-dom": "^4.2.4",
"#testing-library/react": "^9.5.0",
"#testing-library/user-event": "^7.2.1",
"axios": "^0.21.0",
"react": "^17.0.1",
"react-bootstrap": "^1.4.0",
"react-dom": "^17.0.1",
"react-router-bootstrap": "^0.25.0",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.4",
"redux": "^4.0.5",
"redux-devtools-extension": "^2.13.8",
"redux-thunk": "^2.3.0",
"tachyons": "^4.12.0"
},
It looks like you are using the latest npm version (v7).
As mention in the logs, try with
npm install --legacy-peer-deps
The last time npm Blog mentioned the --legacy-peer-deps flag was while their beta version of npm v7 got public. To read more about the flag go here.
Two ways:
npm install <package-name> --legacy-peer-deps
install Recommended node version for most users
The better way is to install the recommended version of node to work for all packages.
Try installing recommended nodejs version(screen shot below). Which should fix this issue.
Here is a recreation of this error and its solution (screenshots below):
Problem:
Nodejs : Latest features:
Solution:
Nodejs : Recommended for most users:
Installing the Recommended version of node js fixed this issue instantly allowing installation of relevant dependancies.
Incase you are facing this issue with a react-native dependency then once you have installed the recommended version be sure to update your pod file.
Try using Node.js latest "Recommended For Most Users" Version .
it worked for me
I had this issue and nothing seemed to work.
I fixed it by downgrading node to version 12.14.1
Uninstall the current node version and install 12.14.1 from this link
Tried for Mac, it worked.. follow the steps for upgrading to the latest LTS
Before updating the Node.js release, check which version you are currently using with:
node -v
Next, clear npm cache with the command:
npm cache clean -f
Install n globally:
npm install -g n
Now that you have n installed, you can use the module to install the latest stable release of Node.js:
sudo n stable
Alternatively, you can install the Node.js release with the latest features:
sudo n latest
Or, install a specific version number with:
n [version.number]
I faced the same issue, so id run this command
npm config set legacy-peer-deps true
Then I simply created my react app using redux template by following
npx create-react-app app-name --template redux
worked for me!!
Its a little bit late but you can resolve this with --force or --legacy-peer-deps options. Either should work as mentioned in the error reported by npm
Try adding it with yarn. Worked for me

ionic 2 - watch fail

I'm using ionic 2 framework on ubuntu with node v6.9.4 and npm 3.10.10, and after the last upgrade i've gotting the error when i run "ionic serve":
[11:46:06] ionic-app-scripts 1.0.0
[11:46:06] watch started ...
[11:46:06] build dev started ...
[11:46:06] clean started ...
[11:46:06] clean finished in 59 ms
[11:46:06] copy started ...
[11:46:06] transpile started ...
[11:46:57] transpile finished in 50.84 s
[11:46:57] webpack started ...
[11:47:33] copy finished in 87.03 s
[11:48:16] webpack finished in 78.91 s
[11:48:16] sass started ...
[11:48:27] sass finished in 11.71 s
[11:48:27] build dev finished in 141.78 s
[11:48:30] watch failed: A watch configured to watch the following paths failed to start. It likely that a file
referenced does not exist: /home/te/PhpstormProjects/smarTrip-ionic/src/assets/**/*,
/home/te/PhpstormProjects/smarTrip-ionic/src/index.html,
/home/te/PhpstormProjects/smarTrip-ionic/src/manifest.json,
/home/te/PhpstormProjects/smarTrip-ionic/src/service-worker.js,
/home/te/PhpstormProjects/smarTrip-ionic/node_modules/ionicons/dist/fonts/**/*,
/home/te/PhpstormProjects/smarTrip-ionic/node_modules/ionic-angular/fonts/**/*,
/home/te/PhpstormProjects/smarTrip-ionic/node_modules/ionic-angular/polyfills/polyfills.js,
/home/te/PhpstormProjects/smarTrip-ionic/node_modules/sw-toolbox/sw-toolbox.js
[11:48:30] ionic-app-script task: "watch"
[11:48:30] Error: A watch configured to watch the following paths failed to start. It likely that a file referenced
does not exist: /home/te/PhpstormProjects/smarTrip-ionic/src/assets/**/*,
/home/te/PhpstormProjects/smarTrip-ionic/src/index.html,
/home/te/PhpstormProjects/smarTrip-ionic/src/manifest.json,
/home/te/PhpstormProjects/smarTrip-ionic/src/service-worker.js,
/home/te/PhpstormProjects/smarTrip-ionic/node_modules/ionicons/dist/fonts/**/*,
/home/te/PhpstormProjects/smarTrip-ionic/node_modules/ionic-angular/fonts/**/*,
/home/te/PhpstormProjects/smarTrip-ionic/node_modules/ionic-angular/polyfills/polyfills.js,
/home/te/PhpstormProjects/smarTrip-ionic/node_modules/sw-toolbox/sw-toolbox.js
npm ERR! Linux 4.4.0-21-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "watch"
npm ERR! node v6.9.4
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! SmartTrip# watch: `ionic-app-scripts watch`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the SmartTrip# watch script 'ionic-app-scripts watch'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the SmartTrip package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ionic-app-scripts watch
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs SmartTrip
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls SmartTrip
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/te/PhpstormProjects/smarTrip-ionic/npm-debug.log
node--v(node:4154) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: channel closed
I already tried to remove the folder node_modules and run npm install again, force the npm cache clean, install the latest version of node.js, but didnt success...
Can anyone please help me?
Tks!
Try adding
"sw-toolbox": "3.4.0"
to the package.json
i finally sloved my problem.
Steps than i do to slove:
remove node_modules folder
edit my package.json like as:
"dependencies": {
"#angular/common": "2.2.1",
"#angular/compiler": "2.2.1",
"#angular/compiler-cli": "2.2.1",
"#angular/core": "2.2.1",
"#angular/forms": "2.2.1",
"#angular/http": "2.2.1",
"#angular/platform-browser": "2.2.1",
"#angular/platform-browser-dynamic": "2.2.1",
"#angular/platform-server": "2.2.1",
"#ionic/storage": "1.1.7",
"ionic-angular": "2.0.0-rc.5",
"ionic-native": "2.2.11",
"ionicons": "3.0.0",
"rxjs": "5.0.0-beta.12",
"zone.js": "0.6.26",
"sw-toolbox": "3.4.0"
},
"devDependencies": {
"#ionic/app-scripts": "1.0.0",
"typescript": "^2.0.3"
},
run sudo npm install --no-optional
Thanks!

Resources