Here's the package.json file:
{
"dependencies": {
"#angular/animations": "^9.1.3",
"#angular/cdk": "^11.1.1",
"#angular/common": "^9.1.3",
"#angular/compiler": "^9.1.3",
"#angular/core": "^9.1.3",
"#angular/forms": "^9.1.3",
"#angular/http": "^7.2.15",
"#angular/localize": "^9.1.3",
"#angular/platform-browser": "^9.1.3",
"#angular/platform-browser-dynamic": "^9.1.3",
"#angular/platform-server": "^9.1.3",
"#angular/router": "^9.1.3",
"#angular/service-worker": "^9.1.3",
"#fortawesome/fontawesome-free-webfonts": "^1.0.9",
"#kolkov/angular-editor": "^1.1.5",
"#ng-bootstrap/ng-bootstrap": "^6.1.0",
"#ng-select/ng-select": "^4.0.0",
"#ngrx/store": "^9.1.0",
"#ngx-rocket/scripts": "4.0.0",
"#ngx-translate/core": "^12.1.2",
"#pioneer-code/pioneer-tree": "^2.1.0",
"#types/async": "^3.0.3",
"#types/d3": "^5.7.2",
"angular-fusioncharts": "3.0.4",
"angular-tree-component": "8.5.6",
"async": "^3.1.0",
"bootstrap": "^4.4.1",
"core-js": "^3.5.0",
"d3": "^5.16.0",
"david": "^12.0.0",
"deep-object-diff": "^1.1.0",
"fusioncharts": "3.15.3",
"fusionmaps": "^3.15.3",
"html2canvas": "^1.0.0-rc.5",
"lodash": "^4.17.15",
"ng-drag-drop": "^5.0.0",
"ng2-dragula": "^2.1.1",
"ngx-bar-rating": "^1.1.0",
"ngx-bootstrap": "^5.2.0",
"ngx-chips": "^2.1.0",
"ngx-color-picker": "^9.1.0",
"ngx-doc-viewer": "^1.1.0",
"ngx-drag-drop": "^2.0.0",
"ngx-export-as": "^1.4.2",
"ngx-freshchat": "^0.2.0",
"ngx-infinite-scroll": "^8.0.1",
"ngx-joyride": "^2.2.11",
"ngx-quill": "^12.0.1",
"ngx-take-until-destroy": "^5.4.0",
"ngx-toastr": "^12.0.1",
"ngx-toggle-switch": "^2.0.5",
"ngx-zone-scheduler": "^2.2.1",
"node-sass": "^4.14.0",
"quill": "^1.3.7",
"rxjs": "^6.5.5",
"socket.io-client": "^3.0.4",
"tslib": "^1.10.0",
"underscore": "^1.10.2",
"uuid": "^7.0.3",
"zone.js": "~0.10.2"
},
"devDependencies": {
"#angular-devkit/build-angular": "^0.901.3",
"#angular/cli": "^9.1.6",
"#angular/compiler-cli": "^9.1.7",
"#angular/language-service": "^9.1.3",
"#biesbjerg/ngx-translate-extract": "^6.0.4",
"#ngrx/store-devtools": "^9.1.0",
"#ngx-rocket/scripts": "^4.0.0",
"#types/file-saver": "^2.0.1",
"#types/jasmine": "^3.5.10",
"#types/jasminewd2": "^2.0.8",
"#types/lodash": "4.14.157",
"#types/node": "^13.13.4",
"#types/underscore": "^1.9.4",
"#types/uuid": "^7.0.3",
"chalk": "^4.0.0",
"codelyzer": "^5.1.2",
"copyfiles": "^2.1.1",
"cpy": "^8.0.0",
"file-saver": "^2.0.2",
"hads": "^2.0.1",
"htmlhint": "^0.11.0",
"https-proxy-agent": "^5.0.0",
"jasmine-core": "^3.5.0",
"jasmine-spec-reporter": "^5.0.2",
"karma": "^5.0.1",
"karma-chrome-launcher": "^3.1.0",
"karma-cli": "^2.0.0",
"karma-coverage-istanbul-reporter": "^2.1.1",
"karma-jasmine": "^3.1.1",
"karma-jasmine-html-reporter": "^1.5.3",
"karma-junit-reporter": "^2.0.1",
"ng-packagr": "^9.0.0",
"protractor": "^5.4.3",
"puppeteer": "^3.0.1",
"rxjs-tslint": "^0.1.7",
"stylelint": "^13.3.3",
"stylelint-config-recommended-scss": "^4.2.0",
"stylelint-config-standard": "^20.0.0",
"stylelint-scss": "^3.17.1",
"ts-node": "^8.9.1",
"tslint": "^6.1.1",
"typescript": "~3.8.3",
"webpack": "^4.43.0"
},
"peerDependencies": {
"mobx": "5.15.1",
"mobx-angular": "3.0.3"
}
}
When running npm install i got the following error:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: bloom#1.0.0
npm ERR! Found: #angular/common#9.1.13
npm ERR! node_modules/#angular/common
npm ERR! #angular/common#"^9.1.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer #angular/common#"^11.0.0 || ^12.0.0-0" from #angular/cdk#11.2.13
npm ERR! node_modules/#angular/cdk
npm ERR! #angular/cdk#"^11.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 /Users/ayoubkhial/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/ayoubkhial/.npm/_logs/2021-07-12T23_35_44_624Z-debug.log
And when running the following command npm install --force i got this error:
You have "#angular/cdk": "^11.1.1" looking for #angular/common#"^11.0.0 || ^12.0.0-0" but your package.json has "#angular/common": "^9.1.3"
From the error message here,
npm ERR! Could not resolve dependency:
npm ERR! peer #angular/common#"^11.0.0 || ^12.0.0-0" from #angular/cdk#11.2.13
npm ERR! node_modules/#angular/cdk
npm ERR! #angular/cdk#"^11.1.1" from the root project
I recommend syncing up your angular packages so that they are on the same version. This could mean either upgrading all the #angular packages to v11 or downgrading the cdk to v9.
In some cases you can use --force or --legacy-peer-deps to tell the installation to either ignore certain peer dependencies or use legacy dependencies but since your mismatch is between core angular packages I wouldn't recommend that approach here.
I fixed it by deleting node_modules, package-lock.json directly from project directory. Clean cache by running command npm cache clean --force. Now try npm i.
Related
I am working on a NestJS project. I am trying to start project but I am getting error: dotenv: command not found in the terminal. I have checked the packages.json and I can see to dotenv installed. Moreover I have tried to install dotenv with Yarn but still I am getting same error.
Dependencies in package.json:
"dependencies": {
"#nestjs/common": "^8.1.1",
"#nestjs/config": "1.0.2",
"#nestjs/core": "^8.1.1",
"#nestjs/jwt": "^8.0.0",
"#nestjs/passport": "^8.0.1",
"#nestjs/platform-express": "^8.1.1",
"#nestjs/swagger": "^5.1.2",
"#prisma/client": "3.3.0",
"bcrypt": "^5.0.1",
"class-transformer": "^0.4.0",
"class-validator": "^0.13.1",
-> "dotenv": "^10.0.0",
"express-rate-limit": "^5.5.0",
"helmet": "^4.6.0",
"nanoid": "^3.1.30",
"nodemailer": "^6.7.0",
"passport": "^0.5.0",
"passport-jwt": "^4.0.0",
"reflect-metadata": "^0.1.12",
"request-ip": "^2.1.3",
"rimraf": "^3.0.2",
"rxjs": "^7.4.0",
"swagger-ui-express": "^4.1.4"
},
The starting script that I am using:
"start:dev": "dotenv -e env/local.env -- nest start --watch",
I found the solution and it may help someone else. To run dotenv command in terminal we need dotenv-cli. Installing dotenv-cli with yarn add dotenv-cli solved my problem.
I cloned one repository from github then installed npm packages using npm install, but I get this error
"devDependencies": {
"#vue/cli-plugin-babel": "~4.5.0",
"#vue/cli-plugin-eslint": "~4.5.0",
"#vue/cli-service": "~4.5.0",
"#vue/composition-api": "^1.0.0-rc.6",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"less": "^4.1.1",
"less-loader": "^8.0.0",
"node-sass": "^5.0.0",
"sass": "^1.32.6",
"sass-loader": "^7.3.1",
"url-loader": "^4.1.1",
"vue-template-compiler": "^2.6.11"
},
How can I get rid of this problem?
I have found this issue from my project which I built last two weeks. Now, this month (May 2021) sass-lang says LibSass and Node Sass are deprecated
try this commands-
yarn remove node-sass
yarn add sass
or npm commands
I already had angular project that ran in 4 version. While installing new project, unfortunately i have installed 6 version of angular cli. This throw me an error 'Your global Angular CLI version is greater than your local version' while running ng serve command in old project that ran in 4 version. Again i tried to update my anglar local version. But now i have got an error This version of CLI is only compatible with Angular version 5.0.0 or higher. My package.json is following:
{
"name": "authority-client",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"#angular-devkit/core": "^0.7.2",
"#angular/animations": "^4.2.4",
"#angular/common": "^4.2.4",
"#angular/compiler": "^4.2.4",
"#angular/core": "^4.2.4",
"#angular/forms": "^4.2.4",
"#angular/http": "^4.2.4",
"#angular/platform-browser": "^4.2.4",
"#angular/platform-browser-dynamic": "^4.2.4",
"#angular/router": "^4.2.4",
"#types/file-saver": "^1.3.0",
"angular2-cookie": "^1.2.6",
"core-js": "^2.4.1",
"file-saver": "^1.3.8",
"ng2-toastr": "^4.1.2",
"ngx-bootstrap": "^2.0.1",
"ngx-loading": "^1.0.14",
"npm": "^5.5.1",
"postcss-loader": "^2.0.9",
"rxjs": "^5.4.2",
"sweetalert2": "^7.22.0",
"zone.js": "^0.8.14"
},
"devDependencies": {
"#angular-devkit/build-angular": "~0.7.0",
"#angular/cli": "^6.1.5",
"#angular/compiler-cli": "^4.2.4",
"#angular/language-service": "^4.2.4",
"#ngtools/webpack": "^6.1.5",
"#types/jasmine": "~2.5.53",
"#types/jasminewd2": "~2.0.2",
"#types/node": "~6.0.60",
"angular-ide": "^0.9.44",
"codelyzer": "~3.1.1",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "^5.4.0",
"ts-node": "~3.2.0",
"tslint": "~5.3.2",
"typescript": "~2.3.3"
}
}
Can someone fix this error. I have been tried from last 2 days, but i cant find any appropriate solution.
I think this is what you're looking for.
Other answers simply forgot to include the -g parameter.
npm install -g #angular/cli#1.4.9
It's all said in the error itself. You're not installing it globally ;)
Hope this solves your issues.
UPDATE:
To update Angular CLI to a new version, you must update both the global package and your project's local package.
Global package:
npm uninstall -g #angular/cli
npm cache verify // If npm version is < 5 then use `npm cache clean`
npm install -g #angular/cli#latest
Local project package:
// Use rmdir /S/Q node_modules dist in Windows Command Prompt;
// Use rm -r -fo node_modules, dist in Windows PowerShell
rm -rf node_modules dist
npm install --save-dev #angular/cli#latest
npm install
For more info check out the ReadMe file on GitHub.
Use CLI version 1.4.9 with angular 4.
npm install #angular/cli#1.4.9
"devDependencies": {
"#angular-devkit/build-angular": "~0.7.0",
"#angular/cli": "1.4.9",
....
....
}
you can refer
How to install Angular-CLI with Angular v4.x
You can solve your problem by running:
npm install --save-dev #angular/cli#latest
I am upgrading from angular 2 to angular 5.
after upgradation I am seeing the below errors in the the ts file.
in angular5 do I need to remove #angular/core and #angular/router
after upgradation providing the package.json also
providing my error and code snippet below.
can you tell me how to fix it.
error
[ts] Cannot find module '#angular/core'.
[ts] Cannot find module '#angular/router'.
code
import {Component, ElementRef, Input,Output,EventEmitter,Inject, OnInit,ViewChild} from '#angular/core';
import {KendoGridComponent} from '../grid/grid.component'
import { Router} from '#angular/router';
package.json
{
"name": "SPORTS",
"version": "1.0.0",
"description": "SPORTS player - v0.2.37.1",
"engines": {
"node": "7.10.1"
},
"license": "ISC",
"dependencies": {
"#angular/animations": "^5.2.2",
"#angular/common": "^5.2.2",
"#angular/compiler": "^5.2.2",
"#angular/compiler-cli": "^5.2.2",
"#angular/core": "^5.2.2",
"#angular/forms": "^5.2.2",
"#angular/http": "^5.2.2",
"#angular/platform-browser": "^5.2.2",
"#angular/platform-browser-dynamic": "^5.2.2",
"#angular/platform-server": "^5.2.2",
"#angular/router": "^5.2.2",
"#angular/upgrade": "2.0.0",
"#ng-idle/core": "2.0.0-beta.2",
"#ng-idle/keepalive": "2.0.0-beta.2",
"#types/jquery": "^3.2.10",
"#types/node": "^8.0.18",
"#types/underscore": "^1.8.1",
"#types/webpack": "^3.0.5",
"angular2-in-memory-web-api": "0.0.21",
"angular2-router-loader": "^0.3.5",
"angular2-template-loader": "^0.6.2",
"awesome-typescript-loader": "^3.2.1",
"babel-minify-webpack-plugin": "0.2.0",
"bootstrap": "^3.3.6",
"commander": "^2.6.0",
"compression-webpack-plugin": "1.0.1",
"core-js": "^2.4.1",
"css-loader": "^0.28.7",
"del": "^3.0.0",
"express": "^4.14.1",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^0.11.2",
"file-saver": "^1.3.3",
"html-webpack-plugin": "^2.30.1",
"http-post": "^0.1.1",
"http-proxy": "^1.8.1",
"jquery": "2.2.3",
"pako": "^1.0.5",
"path": "^0.12.7",
"raw-loader": "^0.5.1",
"reflect-metadata": "^0.1.3",
"require": "^2.4.20",
"rxjs": "^5.5.6",
"style-loader": "^0.18.2",
"text-encoding-shim": "^1.0.0",
"to-string-loader": "^1.1.5",
"ts": "0.0.0",
"typescript": "^2.4.2",
"uglifyjs-webpack-plugin": "^0.4.6",
"underscore": "^1.8.3",
"webpack": "^3.5.6",
"webpack-dev-server": "^2.7.1",
"webpack-merge": "^4.1.0",
"zone.js": "^0.6.23"
},
"devDependencies": {
"gulp": "^3.9.1",
"gulp-clean-css": "^3.8.0",
"gulp-concat": "^2.6.1",
"gulp-util": "^3.0.8",
"jasmine-core": "~2.4.1",
"jasmine-expect": "^3.0.1",
"jasmine-jquery": "^2.1.1",
"karma": "^1.2.0",
"karma-chrome-launcher": "^0.2.3",
"karma-cli": "^0.1.2",
"karma-coverage": "^1.1.1",
"karma-htmlfile-reporter": "^0.2.2",
"karma-jasmine": "^0.3.8",
"karma-jquery": "^0.1.0",
"karma-sourcemap-loader": "^0.3.7",
"karma-typescript": "^2.1.4",
"karma-typescript-preprocessor": "^0.3.0"
},
"main": "server.js",
"scripts": {
"dev": "webpack-dev-server --config ./webpack.dev.js --inline --progress --color ",
"postinstall": "webpack -p --config ./webpack.prod.js --progress --profile --bail",
"start": "node server.js"
},
"repository": {
"type": "git",
"url": "https://github.iSPORTS.com/player-Replatform/webcomponent.git"
}
}
You need to install these dependencies manually.
$ npm i #angular/core -s
$ npm i #angular/router -s
I also faced the same issue while upgrading because of npm. I suggest you start using yarn instead.
Is this error coming from the compiler or an IDE tool like Intellisense? I find sometimes with installing/branch switching IDE tools like this can get confused and require a restart of the IDE.
If it won't compile, are the modules actually in your node_modules? If not, delete your package-lock.json or shrinkwrap.json and install again. NPM adds the package lock by default as of 5.0 and I find with complicated dependencies it can mess up sometimes.
If they are there, run npm prune and npm install again.
If that doesn't work, nuke node_modules alongside any lock file and install again.
Do any third-party libraries require an update? Angular 5 had some breaking API changes. Check their docs if that's the case.
Consider Yarn.
I'm pretty sure it's the first one, but I'll leave all the steps I usually take just for the sake of completion.
Make sure you are exporting RouterModule in each router module that has children. In the angular documentation this is not explicitly stated as being necessary -- it's merely included in the examples -- but it is necessary, as one finds out after the customary several hours of edit-run-sigh, edit-run-shout, edit-run-google-editWithHope-scream-considerSmashingKeyboard, edit-run-cry, edit-run-solveByAccident-feelMomentaryPride (repeat).
The upshot: include RouterModule. The meta upshot: pay attention to the little seemingly unnecessary code in official documentation.
I have angular 2 project, after updating #angular/cli ,webpack and typescript version I get this error, confusing side is that I only get error in this angular 2 project, another one works perfectly fine. I share error and package.json below. I have updated angular cli globally and locally. Is there any problem with versions or?
\node_modules\#angular\cli\node_modules\webpack\lib\Compilation.js:329
if(_this.profile) {
^
TypeError: Cannot read property 'profile' of null
package.json
{
"name": "crm-ca",
"version": "0.0.0",
"license": "MIT",
"angular-cli": {},
"scripts": {
"start": "ng serve",
"lint": "tslint \"src/**/*.ts\"",
"test": "ng test",
"pree2e": "webdriver-manager update",
"e2e": "protractor"
},
"private": true,
"dependencies": {
"#angular/common": "^2.3.1",
"#angular/compiler": "^2.3.1",
"#angular/core": "^2.3.1",
"#angular/forms": "^2.3.1",
"#angular/http": "^2.3.1",
"#angular/platform-browser": "^2.3.1",
"#angular/platform-browser-dynamic": "^2.3.1",
"#angular/router": "^3.3.1",
"angular2-cookie": "^1.2.5",
"angular2-text-mask": "^2.1.0",
"bootstrap": "^4.0.0-alpha.3",
"core-js": "^2.4.1",
"rxjs": "^5.0.1",
"ts-helpers": "^1.1.1",
"zone.js": "^0.7.2"
},
"devDependencies": {
"#angular/cli": "^1.0.0",
"#angular/compiler-cli": "^2.3.1",
"#types/bootstrap": "^3.3.32",
"#types/jasmine": "2.5.38",
"#types/jquery": "^2.0.40",
"#types/node": "^6.0.42",
"codelyzer": "~2.0.0-beta.1",
"jasmine-core": "2.5.2",
"jasmine-spec-reporter": "2.5.0",
"karma": "1.2.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.2.1",
"protractor": "~4.0.13",
"ts-node": "1.2.1",
"tslint": "^4.0.2",
"typescript": "^2.2.2",
"webpack": "^2.2.0",
"webpack-dev-server": "^2.1.0-beta.9"
}
}
I recommend removing webpack and webpack-dev-server from your package.json. angular-cli uses its own version of webpack which is clashing with what's in your package.json. I had this issue and that's the solution that worked for me.
I found the following here and it worked for me:
npm uninstall --save-dev webpack
sudo rm -R node_modules
npm install
Hey remove the webpack and webpack-dev-server from your package.json and run the npm uninstall --save-dev webpack this should handle your situation.