Reputation: 63
CREATE firstapp/package.json (1209 bytes)
CREATE firstapp/README.md (1018 bytes)
CREATE firstapp/tsconfig.json (783 bytes)
CREATE firstapp/tslint.json (3185 bytes)
CREATE firstapp/.editorconfig (274 bytes)
CREATE firstapp/.gitignore (631 bytes)
CREATE firstapp/.browserslistrc (703 bytes)
CREATE firstapp/karma.conf.js (1425 bytes)
CREATE firstapp/tsconfig.app.json (287 bytes)
CREATE firstapp/tsconfig.spec.json (333 bytes)
CREATE firstapp/src/favicon.ico (948 bytes)
CREATE firstapp/src/index.html (294 bytes)
CREATE firstapp/src/main.ts (372 bytes)
CREATE firstapp/src/polyfills.ts (2830 bytes)
CREATE firstapp/src/styles.css (80 bytes)
CREATE firstapp/src/test.ts (753 bytes)
CREATE firstapp/src/assets/.gitkeep (0 bytes)
CREATE firstapp/src/environments/environment.prod.ts (51 bytes)
CREATE firstapp/src/environments/environment.ts (662 bytes)
CREATE firstapp/src/app/app-routing.module.ts (245 bytes)
CREATE firstapp/src/app/app.module.ts (393 bytes)
CREATE firstapp/src/app/app.component.html (24955 bytes)
CREATE firstapp/src/app/app.component.spec.ts (1063 bytes)
CREATE firstapp/src/app/app.component.ts (212 bytes)
CREATE firstapp/src/app/app.component.css (0 bytes)
CREATE firstapp/e2e/protractor.conf.js (904 bytes)
CREATE firstapp/e2e/tsconfig.json (274 bytes)
CREATE firstapp/e2e/src/app.e2e-spec.ts (659 bytes)
CREATE firstapp/e2e/src/app.po.ts (274 bytes)
| Installing packages (npm)...npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/jasmine-core
npm ERR! dev jasmine-core@"~3.6.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer jasmine-core@">=3.7.1" from [email protected]
npm ERR! node_modules/karma-jasmine-html-reporter
npm ERR! dev karma-jasmine-html-reporter@"^1.5.0" 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\vishn\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\vishn\AppData\Local\npm-cache\_logs\2021-05-10T00_27_07_509Z-debug.log
× Package install failed, see above.
The Schematic workflow failed. See above.
Angular CLI: 11.2.12
Node: 16.1.0
OS: win32 x64
Angular: <error>
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1102.12 (cli-only)
@angular-devkit/build-angular <error>
@angular-devkit/core 11.2.12 (cli-only)
@angular-devkit/schematics 11.2.12 (cli-only)
@angular/cli 11.2.12 (cli-only)
@schematics/angular 11.2.12 (cli-only)
@schematics/update 0.1102.12 (cli-only)
rxjs 6.6.3 (cli-only)
typescript <error>
I tried to create new Angular project and got this error. I pasted my error here and the versions of angular and its dependency used (ng version). I installed Node.js using installer and angular cli using using cmd command. But I can't create a new project(ng new project-name) Please help me to resolve this. Thanks in advance
Upvotes: 6
Views: 13715
Reputation: 99
Had the same problem. Apparently npm just didn't have access to these packages, which was why it didn't find them. The following did it for me:
sudo ng new firstapp
Upvotes: -1
Reputation: 2341
The problem with our enviornment was that the version of node we were using was incompatible. We had v19 and it needes 10.13.x/12.11.x or later minor. See this referenced chart.
Upvotes: 0
Reputation: 21
npm uninstall @angular/cli -g
npm cache clean --force
npm cache verify
npm install -g @angular/cli
Upvotes: 2
Reputation: 297
Workaround
There is a workaround for starting a new Angular project:
ng new project --skip-install
cd project
npm install
(or if that fails npm install --force
)
I discovered this within the comments of the open issue for this error on angular-cli github repo which Ammar M Mashfj linked to in their answer: https://github.com/angular/angular-cli/issues/20719#issuecomment-835810313
Upvotes: 1
Reputation: 102
I had a similar error, so I chose a newer node version using n library, like here: https://nkaushik.com/nodejs/nodejs-version-manager-n/
then I updated my angular version with :
install -g @angular/cli
oh, and don't forget to turn off your VPN
Upvotes: 0
Reputation: 56
Check this, it's the same issue.
Open the folder you create with ng new and open the package.json file. In devDependencies change the version of "jasmine-core" 3.6.0 to 3.7.1 and "karma-jasmine-html-reporter" from 1.5.0 to 1.6.0 and save it. Than go back to Terminal and go to your project and run npm install. Now it works und you can run ng serve.
Upvotes: 0
Reputation: 1
you can also Downgrade npm from 7 to 6 using npm install -g npm@6
to fix this probleme
if you have another problem during the instalation, delete npm and npm-cache in: \AppData\Roaming
and try again
Upvotes: 0
Reputation: 104
this is an error in angular-cli by some outdated packages , it has been solved in their repository in github , but they haven't published it yet to npmjs , you can solve it in 2 ways:
this is an open issue for this error on angular-cli github repo https://github.com/angular/angular-cli/issues/20719
Upvotes: 3