frederiksen / angular-electron-boilerplate

Template for building modern and secure Electron apps
MIT License
57 stars 23 forks source link

Can't update angular #45

Open charafsalmi opened 2 years ago

charafsalmi commented 2 years ago

Here is the log. Windows 10.

PS C:\Users\username\workspace\angular-electron-boilerplate> git reset --hard origin/master
HEAD is now at a9f06f8 Electron update
PS C:\Users\username\workspace\angular-electron-boilerplate> npm run update:angular

> angular-electron-boilerplate@0.0.0 update:angular
> ng update @angular/cli @angular/core

The installed Angular CLI version is outdated.
Installing a temporary Angular CLI versioned 13.3.1 to perform the update.
Installing packages for tooling via npm.
Installed packages for tooling via npm.
Using package manager: 'npm'
Collecting installed dependencies...
Found 39 dependencies.
Fetching dependency metadata from registry...
Updating multiple major versions of '@angular/cli' at once is not supported. Please migrate each major version individually.
Run 'ng update @angular/cli@11' in your workspace directory to update to latest '11.x' version of '@angular/cli'.

For more information about the update process, see https://update.angular.io/?v=10.0-11.0

And then:

PS C:\Users\username\workspace\angular-electron-boilerplate> ng update @angular/cli@11     
Your global Angular CLI version (13.2.5) is greater than your local version (10.1.0). The local Angular CLI version is used.

To disable this warning use "ng config -g cli.warnings.versionMismatch false".
The installed local Angular CLI version is older than the latest stable version.
Installing a temporary version to perform the update.
Installing packages for tooling via npm.
Installed packages for tooling via npm.
Using package manager: 'npm'
Collecting installed dependencies...
Found 39 dependencies.
Fetching dependency metadata from registry...
    Updating package.json with dependency @angular-devkit/build-angular @ "0.1102.19" (was "0.1001.1")...
    Updating package.json with dependency @angular/animations @ "11.2.14" (was "10.1.1")...
    Updating package.json with dependency @angular/cli @ "11.2.19" (was "10.1.0")...
    Updating package.json with dependency @angular/common @ "11.2.14" (was "10.1.1")...
    Updating package.json with dependency @angular/compiler @ "11.2.14" (was "10.1.1")...
    Updating package.json with dependency @angular/compiler-cli @ "11.2.14" (was "10.1.1")...
    Updating package.json with dependency @angular/core @ "11.2.14" (was "10.1.1")...
    Updating package.json with dependency @angular/forms @ "11.2.14" (was "10.1.1")...
    Updating package.json with dependency @angular/language-service @ "11.2.14" (was "10.1.1")...
    Updating package.json with dependency @angular/platform-browser @ "11.2.14" (was "10.1.1")...
    Updating package.json with dependency @angular/platform-browser-dynamic @ "11.2.14" (was "10.1.1")...
    Updating package.json with dependency @angular/router @ "11.2.14" (was "10.1.1")...
    Updating package.json with dependency karma @ "6.3.17" (was "5.1.0")...
    Updating package.json with dependency typescript @ "4.1.6" (was "3.9.5")...
    Updating package.json with dependency zone.js @ "0.11.5" (was "0.11.1")...
  UPDATE package.json (3188 bytes)
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: angular-electron-boilerplate@0.0.0
npm ERR! Found: @angular-devkit/build-angular@0.1001.1
npm ERR! node_modules/@angular-devkit/build-angular
npm ERR!   dev @angular-devkit/build-angular@"^0.1102.19" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev @angular-devkit/build-angular@"^0.1102.19" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @angular/compiler-cli@11.2.14
npm ERR! node_modules/@angular/compiler-cli
npm ERR!   peer @angular/compiler-cli@"^11.0.0 || ^11.2.0-next" from @angular-devkit/build-angular@0.1102.19
npm ERR!   node_modules/@angular-devkit/build-angular
npm ERR!     dev @angular-devkit/build-angular@"^0.1102.19" 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! See C:\Users\username\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\username\AppData\Local\npm-cache\_logs\2022-04-04T21_52_24_294Z-debug.log
✖ Package install failed, see above.

Here is the log:

0 verbose cli [
0 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
0 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
0 verbose cli   'install',
0 verbose cli   '--quiet'
0 verbose cli ]
1 info using npm@8.1.2
2 info using node@v16.13.2
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:C:\Program Files\nodejs\node_modules\npm\npmrc Completed in 2ms
6 timing config:load:builtin Completed in 2ms
7 timing config:load:cli Completed in 2ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:C:\Users\username\workspace\angular-electron-boilerplate\.npmrc Completed in 0ms
10 timing config:load:project Completed in 1ms
11 timing config:load:file:C:\Users\username\.npmrc Completed in 1ms
12 timing config:load:user Completed in 1ms
13 timing config:load:file:C:\Users\username\AppData\Roaming\npm\etc\npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 1ms
16 timing config:load:credentials Completed in 1ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 10ms
19 timing npm:load:configload Completed in 11ms
20 timing npm:load:setTitle Completed in 0ms
21 timing npm:load:setupLog Completed in 1ms
22 timing config:load:flatten Completed in 2ms
23 timing npm:load:cleanupLog Completed in 2ms
24 timing npm:load:configScope Completed in 0ms
25 timing npm:load:projectScope Completed in 1ms
26 timing npm:load Completed in 17ms
27 timing arborist:ctor Completed in 1ms
28 timing idealTree:init Completed in 837ms
29 timing idealTree:userRequests Completed in 0ms
30 silly idealTree buildDeps
31 silly fetch manifest @angular-devkit/build-angular@^0.1102.19
32 http fetch GET 200 https://registry.npmjs.org/@angular-devkit%2fbuild-angular 283ms (cache revalidated)
33 silly fetch manifest @angular/compiler-cli@^11.2.14
34 http fetch GET 200 https://registry.npmjs.org/@angular%2fcompiler-cli 236ms (cache revalidated)
35 silly fetch manifest @angular/compiler@^11.2.14
36 http fetch GET 200 https://registry.npmjs.org/@angular%2fcompiler 1036ms (cache revalidated)
37 silly fetch manifest typescript@^4.1.6
38 http fetch GET 200 https://registry.npmjs.org/typescript 221ms (cache revalidated)
39 silly fetch manifest typescript@>=4.0 <4.2
40 silly fetch manifest @angular/localize@^11.0.0 || ^11.2.0-next
41 http fetch GET 200 https://registry.npmjs.org/@angular%2flocalize 1561ms (cache revalidated)
42 silly fetch manifest @angular/service-worker@^11.0.0 || ^11.2.0-next
43 http fetch GET 200 https://registry.npmjs.org/@angular%2fservice-worker 590ms (cache revalidated)
44 silly fetch manifest @angular/common@^11.2.14
45 http fetch GET 200 https://registry.npmjs.org/@angular%2fcommon 1040ms (cache revalidated)
46 silly fetch manifest @angular/core@^11.2.14
47 http fetch GET 200 https://registry.npmjs.org/@angular%2fcore 1511ms (cache revalidated)
48 silly fetch manifest rxjs@~6.5.3
49 http fetch GET 200 https://registry.npmjs.org/rxjs 8ms (cache hit)
50 silly fetch manifest zone.js@^0.11.5
51 http fetch GET 200 https://registry.npmjs.org/zone.js 201ms (cache revalidated)
52 silly fetch manifest karma@^6.3.17
53 http fetch GET 200 https://registry.npmjs.org/karma 187ms (cache revalidated)
54 silly fetch manifest ng-packagr@^11.0.0 || ^11.2.0-next
55 http fetch GET 200 https://registry.npmjs.org/ng-packagr 844ms (cache revalidated)
56 silly fetch manifest tslib@^2.0.0
57 http fetch GET 200 https://registry.npmjs.org/tslib 6ms (cache hit)
58 silly fetch manifest protractor@~7.0.0
59 http fetch GET 200 https://registry.npmjs.org/protractor 854ms (cache revalidated)
60 silly fetch manifest tailwindcss@^2.0.0
61 http fetch GET 200 https://registry.npmjs.org/tailwindcss 918ms (cache revalidated)
62 silly fetch manifest autoprefixer@^10.0.2
63 http fetch GET 200 https://registry.npmjs.org/autoprefixer 216ms (cache revalidated)
64 silly fetch manifest postcss@^8.1.0
65 http fetch GET 200 https://registry.npmjs.org/postcss 269ms (cache revalidated)
66 silly fetch manifest tslint@~6.1.0
67 http fetch GET 200 https://registry.npmjs.org/tslint 893ms (cache revalidated)
68 silly fetch manifest @angular/animations@^11.2.14
69 http fetch GET 200 https://registry.npmjs.org/@angular%2fanimations 1593ms (cache revalidated)
70 silly fetch manifest @angular/cli@^11.2.19
71 http fetch GET 200 https://registry.npmjs.org/@angular%2fcli 8ms (cache hit)
72 silly fetch manifest @angular/forms@^11.2.14
73 http fetch GET 200 https://registry.npmjs.org/@angular%2fforms 1112ms (cache revalidated)
74 silly fetch manifest @angular/platform-browser@^11.2.14
75 http fetch GET 200 https://registry.npmjs.org/@angular%2fplatform-browser 557ms (cache revalidated)
76 silly fetch manifest @angular/language-service@^11.2.14
77 http fetch GET 200 https://registry.npmjs.org/@angular%2flanguage-service 257ms (cache revalidated)
78 silly fetch manifest @angular/platform-browser-dynamic@^11.2.14
79 http fetch GET 200 https://registry.npmjs.org/@angular%2fplatform-browser-dynamic 609ms (cache revalidated)
80 silly fetch manifest @angular/router@^11.2.14
81 http fetch GET 200 https://registry.npmjs.org/@angular%2frouter 1070ms (cache revalidated)
82 timing idealTree Completed in 17145ms
83 timing command:install Completed in 17155ms
84 verbose stack Error: could not resolve
84 verbose stack     at PlaceDep.failPeerConflict (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\arborist\lib\place-dep.js:544:25)
84 verbose stack     at PlaceDep.place (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\arborist\lib\place-dep.js:197:21)
84 verbose stack     at new PlaceDep (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\arborist\lib\place-dep.js:71:10)
84 verbose stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:944:31
84 verbose stack     at Array.map (<anonymous>)
84 verbose stack     at Arborist.[buildDepStep] (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:944:8)
84 verbose stack     at async Arborist.buildIdealTree (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:216:7)
84 verbose stack     at async Promise.all (index 1)
84 verbose stack     at async Arborist.reify (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\reify.js:149:5)
84 verbose stack     at async Install.install (C:\Program Files\nodejs\node_modules\npm\lib\install.js:170:5)
85 verbose cwd C:\Users\username\workspace\angular-electron-boilerplate
86 verbose Windows_NT 10.0.18363
87 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--quiet"
88 verbose node v16.13.2
89 verbose npm  v8.1.2
90 error code ERESOLVE
91 error ERESOLVE could not resolve
92 error
93 error While resolving: angular-electron-boilerplate@0.0.0
93 error Found: @angular-devkit/build-angular@0.1001.1
93 error node_modules/@angular-devkit/build-angular
93 error   dev @angular-devkit/build-angular@"^0.1102.19" from the root project
93 error
93 error Could not resolve dependency:
93 error dev @angular-devkit/build-angular@"^0.1102.19" from the root project
93 error
93 error Conflicting peer dependency: @angular/compiler-cli@11.2.14
93 error node_modules/@angular/compiler-cli
93 error   peer @angular/compiler-cli@"^11.0.0 || ^11.2.0-next" from @angular-devkit/build-angular@0.1102.19
93 error   node_modules/@angular-devkit/build-angular
93 error     dev @angular-devkit/build-angular@"^0.1102.19" from the root project
93 error
93 error Fix the upstream dependency conflict, or retry
93 error this command with --force, or --legacy-peer-deps
93 error to accept an incorrect (and potentially broken) dependency resolution.
93 error
93 error See C:\Users\username\AppData\Local\npm-cache\eresolve-report.txt for a full report.
94 verbose exit 1
charafsalmi commented 2 years ago

by making NG use yarn and by using --force on every ng update, I got this and it looks like it works:

{
  "name": "angular-electron-boilerplate",
  "version": "0.0.0",
  "main": "./dist/main/electron-main.js",
  "scripts": {
    "start": "electron .",
    "build:dev:renderer": "ng build",
    "build:prod:renderer": "ng build --configuration production",
    "build:dev:main": "webpack --config ./src/main/webpack.ts --mode development",
    "build:prod:main": "webpack --config ./src/main/webpack.ts --mode production",
    "build:dev:preload": "webpack --config ./src/preload/webpack.ts --mode development",
    "build:prod:preload": "webpack --config ./src/preload/webpack.ts --mode production",
    "build:dev:all": "npm run build:dev:renderer && npm run build:dev:main && npm run build:dev:preload",
    "build:prod:all": "npm run build:prod:renderer && npm run build:prod:main && npm run build:prod:preload",
    "build:watch:renderer": "ng build --watch",
    "build:watch:main": "webpack --watch --config ./src/main/webpack.ts --mode development",
    "build:watch:preload": "webpack --watch --config ./src/preload/webpack.ts --mode development",
    "build:watch:all": "npm-run-all -p -r build:watch:renderer build:watch:main build:watch:preload",
    "update:electron": "npm update electron electron-packager",
    "update:webpack": "npm update webpack webpack-cli",
    "update:angular": "ng update @angular/cli @angular/core",
    "update:material": "npm update @angular/material @angular/cdk",
    "test:test": "ng test",
    "test:lint": "ng lint",
    "test:e2e": "ng e2e",
    "package": "electron-packager . angular-electron-boilerplate --asar --overwrite --prune=true --derefSymlinks=false --ignore=\"/node_modules|/src|.vscode|.editorconfig|.gitignore|.map|angular.json|tslint.json|README.md|package-lock.json|LICENSE\" --out=release-builds",
    "release": "npm run build:prod:all  && npm run package"
  },
  "private": true,
  "dependencies": {},
  "devDependencies": {
    "@angular-devkit/build-angular": "^13.3.1",
    "@angular/animations": "^13.3.1",
    "@angular/cdk": "^13.3.2",
    "@angular/cli": "^13.3.1",
    "@angular/common": "^13.3.1",
    "@angular/compiler": "^13.3.1",
    "@angular/compiler-cli": "^13.3.1",
    "@angular/core": "^13.3.1",
    "@angular/forms": "^13.3.1",
    "@angular/language-service": "^13.3.1",
    "@angular/material": "^13.3.2",
    "@angular/platform-browser": "^13.3.1",
    "@angular/platform-browser-dynamic": "^13.3.1",
    "@angular/router": "^13.3.1",
    "@types/jasmine": "~3.6.0",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "^14.0.13",
    "@types/webpack": "^4.32.1",
    "codelyzer": "^6.0.0",
    "electron": "^12.0.2",
    "electron-packager": "^15.2.0",
    "jasmine-core": "~3.6.0",
    "jasmine-spec-reporter": "~5.0.0",
    "karma": "^6.3.17",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~3.0.2",
    "karma-jasmine": "~4.0.0",
    "karma-jasmine-html-reporter": "^1.5.0",
    "npm-run-all": "^4.1.5",
    "protractor": "~7.0.0",
    "rxjs": "~6.5.3",
    "ts-loader": "^8.0.3",
    "ts-node": "^9.0.0",
    "tslib": "^2.0.0",
    "tslint": "~6.1.0",
    "typescript": "^4.1.6",
    "webpack": "^4.43.0",
    "webpack-cli": "^3.3.11",
    "zone.js": "~0.11.4"
  }
}