ngx-rocket / generator-ngx-rocket

:rocket: Extensible Angular 14+ enterprise-grade project generator
https://ngx-rocket.github.io/
MIT License
1.53k stars 216 forks source link

error after generate project ngx new #611

Closed Paul75 closed 2 years ago

Paul75 commented 3 years ago

I'm submitting a...

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: veep@1.0.0
npm ERR! Found: @angular/compiler@12.2.3
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/localize@12.2.3
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/compiler-cli@12.1.5
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

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

I have the same problem.

Ruslancic commented 3 years ago

I have the same problem.

Try to downgrade your npm version to 6.14.15!

improwise commented 3 years ago

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 commented 2 years ago

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.

ci-rebot commented 2 years ago

:tada: This issue has been resolved in version 10.1.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: