#Error following angular.io guide (installing dependencies)

27 messages · Page 1 of 1 (latest)

candid thunder
#

Hi all, I'm new to node.js and decided to learn angular by following the guide available here
I've tried searching for solutions myself without success and would appreciate if you would be patient with me since I am still new to this environment

I successfully installed node :

> node -v
v20.12.1

and installed angular

> npm install -g @angular/cli
changed 233 packages in 12s

44 packages are looking for funding
  run `npm fund` for details

However trying to install the dependencies for first-app causes a bunch of errors:

> npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @angular-devkit/build-angular@17.3.3
npm ERR! Found: protractor@3.3.0
npm ERR! node_modules/protractor
npm ERR!   dev protractor@"^3.3.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional protractor@"^7.0.0" from @angular-devkit/build-angular@17.3.3
npm ERR! node_modules/@angular-devkit/build-angular
npm ERR!   dev @angular-devkit/build-angular@"^17.3.3" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: protractor@7.0.0
npm ERR! node_modules/protractor
npm ERR!   peerOptional protractor@"^7.0.0" from @angular-devkit/build-angular@17.3.3
npm ERR!   node_modules/@angular-devkit/build-angular
npm ERR!     dev @angular-devkit/build-angular@"^17.3.3" 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\<REDACTED_USERNAME>\AppData\Local\npm-cache\_logs\2024-04-05T14_11_17_258Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: C:\Users\<REDACTED_USERNAME>\AppData\Local\npm-cache\_logs\2024-04-05T14_11_17_258Z-debug-0.log

I'm not too sure on how to resolve these dependency conflicts and attempting to npm install --force causes more warnings to pop up.

This is the package.json included with first-app

{
  "name": "angular.io-example",
  "version": "0.0.0",
  "description": "Example project from an angular.io guide.",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "test": "ng test",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "17.2.4",
    "@angular/common": "17.2.4",
    "@angular/compiler": "17.2.4",
    "@angular/core": "17.2.4",
    "@angular/forms": "17.2.4",
    "@angular/platform-browser": "17.2.4",
    "@angular/platform-browser-dynamic": "17.2.4",
    "@angular/router": "17.2.4",
    "angular-in-memory-web-api": "~0.17.0",
    "rxjs": "~7.8.0",
    "tslib": "^2.3.0",
    "zone.js": "~0.14.0"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^17.3.3",
    "@angular/cli": "17.2.3",
    "@angular/compiler-cli": "17.2.4",
    "@types/jasmine": "~5.1.0",
    "@types/node": "^16.11.35",
    "copyfiles": "^2.4.1",
    "jasmine-core": "~5.1.0",
    "jasmine-marbles": "~0.9.2",
    "jasmine-spec-reporter": "~7.0.0",
    "karma": "~6.4.0",
    "karma-chrome-launcher": "~3.2.0",
    "karma-coverage": "~2.2.0",
    "karma-jasmine": "~5.1.0",
    "karma-jasmine-html-reporter": "~2.1.0",
    "protractor": "^3.3.0",
    "ts-node": "~10.9.0",
    "typescript": "~4.9.3"
  }
}
stable thunder
#

That's a deprecated dependancy for e2e testing, it should not be here anymore.

#

@candid thunder where is your project from? I used your link and the protractor version there is 7.0.0 (versus 3.0.0 on your example).

candid thunder
# stable thunder Hello remove protractor from the package.json and run npm install once again.
> npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: angular.io-example@0.0.0
npm ERR! Found: typescript@4.9.5
npm ERR! node_modules/typescript
npm ERR!   dev typescript@"~4.9.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer typescript@">=5.2 <5.4" from @angular/compiler-cli@17.2.4
npm ERR! node_modules/@angular/compiler-cli
npm ERR!   dev @angular/compiler-cli@"17.2.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\<REDACTED_USERNAME>\AppData\Local\npm-cache\_logs\2024-04-05T14_41_14_796Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: C:\Users\<REDACTED_USERNAME>\AppData\Local\npm-cache\_logs\2024-04-05T14_41_14_796Z-debug-0.log
stable thunder
candid thunder
#

Apologies, I think I supplied one from when i was modifying the values to see if it works.
This is the one that was included

{
  "name": "angular.io-example",
  "version": "0.0.0",
  "description": "Example project from an angular.io guide.",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "test": "ng test",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "17.2.4",
    "@angular/common": "17.2.4",
    "@angular/compiler": "17.2.4",
    "@angular/core": "17.2.4",
    "@angular/forms": "17.2.4",
    "@angular/platform-browser": "17.2.4",
    "@angular/platform-browser-dynamic": "17.2.4",
    "@angular/router": "17.2.4",
    "angular-in-memory-web-api": "~0.17.0",
    "rxjs": "~7.8.0",
    "tslib": "^2.3.0",
    "zone.js": "~0.14.0"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "17.2.3",
    "@angular/cli": "17.2.3",
    "@angular/compiler-cli": "17.2.4",
    "@types/jasmine": "~5.1.0",
    "@types/node": "^16.11.35",
    "copyfiles": "^2.4.1",
    "jasmine-core": "~5.1.0",
    "jasmine-marbles": "~0.9.2",
    "jasmine-spec-reporter": "~7.0.0",
    "karma": "~6.4.0",
    "karma-chrome-launcher": "~3.2.0",
    "karma-coverage": "~2.2.0",
    "karma-jasmine": "~5.1.0",
    "karma-jasmine-html-reporter": "~2.1.0",
    "protractor": "~7.0.0",
    "ts-node": "~10.9.0",
    "typescript": "~4.9.3"
  }
}
stable thunder
candid thunder
#

Ok I'll try that Gerome, thank you

#

Is there a guide for me to follow along locally on my own system?

stable thunder
candid thunder
#

Thank you

candid thunder
stable thunder
candid thunder
#

Just to be clear, it's the download icon on the top right of the screenshot?

stable thunder
#

You clicked on this button?

candid thunder
#

Yes

stable thunder
#

try once more

candid thunder
#

(third time downloading)

stable thunder
#

that's the zip, unzip it

#

well dunno if it can help though ^^

candid thunder
#

yes, i am browsing the contents of the zip

#

extracting the zip still leaves me with this

#

i know windows is kinda dodgy with zip files but even in 7zip it's just an src folder

stable thunder
candid thunder
#

Thank you