Skip to content

error after generate project ngx new #611

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 of 4 tasks
Paul75 opened this issue Oct 1, 2021 · 8 comments
Closed
1 of 4 tasks

error after generate project ngx new #611

Paul75 opened this issue Oct 1, 2021 · 8 comments

Comments

@Paul75
Copy link

Paul75 commented Oct 1, 2021

I'm submitting a...

  • Bug report
  • Feature request
  • Documentation issue or request
  • Question

Current behavior

I do ngx new and after got error :

Running npm install, please wait…
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: @angular/[email protected]
npm ERR! node_modules/@angular/compiler
npm ERR!   @angular/compiler@"^12.1.1" from the root project
npm ERR!   peer @angular/compiler@"12.2.3" from @angular/[email protected]
npm ERR!   node_modules/@angular/localize
npm ERR!     @angular/localize@"^12.1.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/compiler@"12.1.5" from @angular/[email protected]
npm ERR! node_modules/@angular/compiler-cli
npm ERR!   dev @angular/compiler-cli@"~12.1.1" 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 /home/pkbp512/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pkbp512/.npm/_logs/2021-10-01T09_54_02_207Z-debug.log

Expected behavior

after npm install not failed

Minimal reproduction of the problem with instructions

  • ngx new

Environment



ngX-Rocket: 10.0.0
Node.js: v14.17.0
Npm: 7.24.1
OS: linux x64 5.4.0-87-generic

Generated project options:
{
  "generator-ngx-rocket": {
    "version": "10.0.0",
    "props": {
      "location": "path",
      "strict": true,
      "skipInstall": false,
      "skipQuickstart": false,
      "initGit": true,
      "usePrefix": true,
      "appName": "VEEP",
      "target": [
        "web"
      ],
      "ui": "bootstrap",
      "features": [
        "pwa",
        "auth",
        "lazy",
        "e2e"
      ],
      "languages": [
        "en-US",
        "fr-FR"
      ],
      "tools": [
        "prettier"
      ],
      "utility": [
        "lodash",
        "moment"
      ],
      "deploy": "none",
      "projectName": "veep",
      "packageManager": "npm",
      "mobile": [],
      "desktop": [],
      "pwa": true,
      "auth": true,
      "lazy": true,
      "e2e": true,
      "angulartics": false
    }
  }
}

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 12.2.7
Node: 14.17.0
Package Manager: npm 7.24.1
OS: linux x64

Angular: 12.2.8
... animations, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, router, service-worker

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1202.7
@angular-devkit/build-angular   12.2.7
@angular-devkit/core            12.2.7
@angular-devkit/schematics      12.2.7
@angular/cli                    12.2.7
@schematics/angular             12.2.7
rxjs                            6.6.7
typescript                      4.3.5

Others:

@Ruslancic
Copy link

Ruslancic commented Oct 1, 2021

I have same issue! I think this is related to new version of npm@7*!
Just run npm i --legacy-peer-deps!
In this way all errors disapear!

@Paul75
Copy link
Author

Paul75 commented Oct 1, 2021

I found to update last version of angular and packages and now no errors.

I change the package.json like :

"dependencies": {
    "@angular/animations": "^12.2.8",
    "@angular/common": "^12.2.8",
    "@angular/compiler": "^12.2.8",
    "@angular/core": "^12.2.8",
    "@angular/forms": "^12.2.8",
    "@angular/localize": "^12.2.8",
    "@angular/platform-browser": "^12.2.8",
    "@angular/platform-browser-dynamic": "^12.2.8",
    "@angular/router": "^12.2.8",
    "@ngx-translate/core": "^13.0.0",
    "@angular/service-worker": "^12.2.8",
    "@ng-bootstrap/ng-bootstrap": "^11.0.0-beta.2",
    "bootstrap": "^5.1.1",
    "@fortawesome/fontawesome-free": "^5.15.4",
    "lodash": "^4.17.21",
    "moment": "^2.29.1",
    "rxjs": "^6.6.3",
    "tslib": "^2.2.0",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^12.2.7",
    "@angular-eslint/builder": "^12.5.0",
    "@angular-eslint/eslint-plugin": "^12.5.0",
    "@angular-eslint/eslint-plugin-template": "^12.5.0",
    "@angular-eslint/schematics": "^12.5.0",
    "@angular-eslint/template-parser": "^12.5.0",
    "@angular/cli": "^12.2.7",
    "@angular/compiler-cli": "^12.2.8",
    "@angular/language-service": "^12.2.8",
    "@biesbjerg/ngx-translate-extract": "^7.0.4",
    "@biesbjerg/ngx-translate-extract-marker": "^1.0.0",
    "@ngx-rocket/scripts": "^5.1.1",
    "@ngneat/until-destroy": "^8.1.4",
    "@typescript-eslint/eslint-plugin": "4.32.0",
    "@typescript-eslint/parser": "4.32.0",
    "@types/jasmine": "^3.6.2",
    "@types/jasminewd2": "^2.0.8",
    "@types/node": "^12.19.12",
    "@types/lodash": "^4.14.165",
    "eslint": "^7.26.0",
    "eslint-plugin-import": "latest",
    "eslint-plugin-jsdoc": "latest",
    "eslint-plugin-prefer-arrow": "latest",
    "htmlhint": "^0.15.1",
    "https-proxy-agent": "^5.0.0",
    "jasmine-core": "~3.8.0",
    "jasmine-spec-reporter": "~7.0.0",
    "karma": "~6.3.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~3.0.3",
    "karma-jasmine": "~4.0.1",
    "karma-jasmine-html-reporter": "~1.7.0",
    "karma-junit-reporter": "^2.0.1",
    "prettier": "^2.4.1",
    "stylelint-config-prettier": "^8.0.2",
    "pretty-quick": "^3.1.1",
    "husky": "^7.0.2",
    "protractor": "~7.0.0",
    "stylelint": "~13.13.1",
    "stylelint-config-recommended-scss": "~4.3.0",
    "stylelint-config-standard": "~22.0.0",
    "stylelint-scss": "~3.20.1",
    "ts-node": "^10.1.0",
    "typescript": "~4.3.2"
  },

Thanks

@hoefken
Copy link

hoefken commented Oct 8, 2021

I have same issue! I think this is related to new version of npm@7*! Just run npm i --legacy-peer-deps! In this way all errors disapear!

After generating the new project and getting the same errors as listed I used this script and it worked. However I did not check whether firebase was installed before, but afterwards it is missing from the project

{ "generator-ngx-rocket": { "version": "10.0.0", "props": { "location": "path", "strict": true, "skipInstall": false, "skipQuickstart": false, "initGit": true, "usePrefix": true, "appName": "disbubike", "target": [ "web" ], "ui": "material", "layout": "simple", "features": [ "pwa", "auth", "lazy" ], "languages": [ "de-DE", "en-US" ], "tools": [ "prettier", "hads", "jest" ], "utility": [], "deploy": "firebase", "projectName": "foo", "packageManager": "npm", "mobile": [], "desktop": [], "pwa": true, "auth": true, "lazy": true, "e2e": false, "angulartics": false } } }

{ "name": "foo", "version": "1.0.0", "private": true, "scripts": { "ng": "ng", "build": "npm run write:env -s && ng build", "start": "npm run write:env -s && ng serve --proxy-config proxy.conf.js", "deploy": "npm run write:env -s && ng deploy", "serve:sw": "npm run build -s && npx http-server ./dist -p 4200", "lint": "ng lint && stylelint \"src/**/*.scss\" --syntax scss", "test": "npm run write:env -s && ng test", "test:ci": "npm run write:env -s && npm run lint -s && ng test --configuration=ci", "translations:extract": "ngx-translate-extract --input ./src --output ./src/translations/template.json --format=json --clean --sort", "docs": "hads ./docs -o", "write:env": "ngx-scripts env npm_package_version", "prettier": "prettier --write \"./src/**/*.{ts,js,html,scss}\"", "prettier:check": "prettier --list-different \"./src/**/*.{ts,js,html,scss}\"", "postinstall": "npm run prettier -s && husky install", "generate": "ng generate" }, "dependencies": { "@angular/animations": "^12.1.1", "@angular/common": "^12.1.1", "@angular/compiler": "^12.1.1", "@angular/core": "^12.1.1", "@angular/forms": "^12.1.1", "@angular/localize": "^12.1.1", "@angular/platform-browser": "^12.1.1", "@angular/platform-browser-dynamic": "^12.1.1", "@angular/router": "^12.1.1", "@ngx-translate/core": "^13.0.0", "@angular/service-worker": "^12.1.1", "@angular/cdk": "^12.1.1", "@angular/material": "^12.1.1", "@angular/flex-layout": "^12.0.0-beta.34", "material-design-icons-iconfont": "^6.1.0", "rxjs": "^6.6.3", "tslib": "^2.2.0", "zone.js": "~0.11.4" }, "devDependencies": { "@angular-builders/jest": "^12.1.0", "@angular-devkit/build-angular": "~12.1.1", "@angular-eslint/builder": "~12.3.1", "@angular-eslint/eslint-plugin": "~12.3.1", "@angular-eslint/eslint-plugin-template": "~12.3.1", "@angular-eslint/schematics": "~12.3.1", "@angular-eslint/template-parser": "~12.3.1", "@angular/cli": "~12.1.1", "@angular/compiler-cli": "~12.1.1", "@angular/language-service": "~12.1.1", "@biesbjerg/ngx-translate-extract": "^7.0.3", "@biesbjerg/ngx-translate-extract-marker": "^1.0.0", "@ngx-rocket/scripts": "^5.1.0", "@ngneat/until-destroy": "^8.0.4", "@typescript-eslint/eslint-plugin": "4.28.2", "@typescript-eslint/parser": "4.28.2", "@types/jest": "^26.0.19", "@types/node": "^12.19.12", "eslint": "^7.26.0", "eslint-plugin-import": "latest", "eslint-plugin-jsdoc": "latest", "eslint-plugin-prefer-arrow": "latest", "hads": "^3.0.0", "htmlhint": "^0.15.1", "https-proxy-agent": "^5.0.0", "jest": "^27.0.6", "prettier": "^2.2.1", "stylelint-config-prettier": "^8.0.2", "pretty-quick": "^3.1.0", "husky": "^7.0.1", "stylelint": "~13.13.1", "stylelint-config-recommended-scss": "~4.3.0", "stylelint-config-standard": "~22.0.0", "stylelint-scss": "~3.20.1", "ts-node": "^10.1.0", "typescript": "~4.3.2" }, "prettier": { "singleQuote": true, "overrides": [ { "files": "*.scss", "options": { "singleQuote": false } } ] } }

@improwise
Copy link

I have the same problem.

@Ruslancic
Copy link

I have the same problem.

Try to downgrade your npm version to 6.14.15!

@improwise
Copy link

I have the same problem.

Try to downgrade your npm version to 6.14.15!

Thanks. Is there a workaround or upcoming fix for this as the 6.14.15 seems a bit outdated by now?

@sinedied
Copy link
Member

sinedied commented Dec 1, 2021

There are still some packages that did not clean up their peer dependencies properly, and with NPM 7+ it will generate an error on install.
It's a bit annoying, but in the meantime using either npm@6, npm i --legacy-peer-deps or npm i --force should fix the issue.
There should be less of these errors (hopefully none) with the next v11 coming which updates most packages.

@sinedied sinedied added the bug label Dec 1, 2021
ci-rebot pushed a commit that referenced this issue Dec 10, 2021
# [10.1.0](10.0.1...10.1.0) (2021-12-10)

### Bug Fixes

* android package copy ([bcd2328](bcd2328))
* cannot update issue (fix [#607](#607)) ([dd96390](dd96390))
* e2e/cypress templates ([1131898](1131898))
* install errors with npm 7+ (fix [#611](#611)) ([1a273dd](1a273dd))
* jest test config with Angular 13 ([4a427ee](4a427ee))
* missing @popperjs/core peer dependency ([ba0aba5](ba0aba5))
* remove deprecated cordova-plugin-whitelist ([77e1b4f](77e1b4f))
* update command in addon generator ([dd2409b](dd2409b))

### Code Refactoring

* deprecate Protractor in favor of Cypress ([f5c4538](f5c4538))

### Features

* add cypress for e2e test ([#605](#605)) ([6fe85aa](6fe85aa))
* Angular 13 update ([49a3669](49a3669))
* migrate to [@awesome-cordova-plugins](https://github.com/awesome-cordova-plugins) ([4df3fb8](4df3fb8))
* update cypress and add auth support for e2e test ([6f80f69](6f80f69))
* update ionic packages ([839f629](839f629))
* update karma config ([90d40e6](90d40e6))
* update ng-bootstrap for v13 support ([af21e28](af21e28))
* update to Angular 13 ([9b3183c](9b3183c))

### BREAKING CHANGES

* Cypress is now the default choice for e2e tests.
@ci-rebot
Copy link
Collaborator

🎉 This issue has been resolved in version 10.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants