Having trouble in creating a new Angular project - node.js

i tried to create a new angular project but i am having this error
just to know i have the latest version of angular and for node JS i am using the 12.16.2.
ng new project
the output :
/ Installing packages...npm WARN deprecated tslint#6.1.1: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents#1.2.12: fsevents 1 will break on node v14+. Upgrade to fsevents 2 with massive improvements.
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm ERR! Unexpected end of JSON input while parsing near '...er","version":"2.4.9"'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\dell\AppData\Roaming\npm-cache_logs\2020-04-21T17_57_57_578Z-debug.log
× Package install failed, see above.
The Schematic workflow failed. See above.
enter image description here

Sometimes cleaning the cache helps: Update Angular after clearing Cache

It looks like it is a cache error. Reinstalling Angular CLI after clearing the npm cache. The below solution work for me, run below 3 commands one by one
npm install chokidar
npm cache clean --force
npm install -g #angular/cli#latest
Issue
Resolution screen short:

Related

i am using angular 11 i want to do a project but i got errors

ng serve
An unhandled exception occurred: Cannot find module '#angular-devkit/build-angular/package.json'
See "/tmp/ng-lQbnUK/angular-errors.log" for further details.
and when i create the project i got those errors
installing packages (npm)...npm WARN deprecated tslint#6.1.3: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.
npm WARN deprecated chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm ERR! Unexpected end of JSON input while parsing near '...p2zraxyqI5tT/g9UTBUgK'
npm ERR! A complete log of this run can be found in:
npm ERR! /home/safa/.npm/_logs/2021-02-15T15_46_03_482Z-debug.log
✖ Package install failed, see above.
The Schematic workflow failed. See above.
Delete node modules folder & package-lock.json file.
Run again
npm install
ng serve
if that doesn't work, upgrade the dependencies with
npm update
Delete node-modules folder
Then npm i
if error presist again then
npm i #angular-devkit/build-angular

error in creating new angular project error

I want to create a new angular project I used ng new hello-world as project start building it get stuck in | Installing packages... and throw warning that
Installing packages...npm WARN deprecated chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm ERR! Unexpected end of JSON input while parsing near '.../chai":"^3.4.34","#ty'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Devendra Mulewa\AppData\Roaming\npm-
cache\_logs\2020-08-03T03_43_38_617Z-debug.log
× Package install failed, see above.
The Schematic workflow failed. See above.
This solved it for me,
open cmd/terminal as admin mode.
Execute following commands,
npm cache clean --force
npm install

Problem while trying to start an ionic project

I have just installed npm and ionic following the instructions on ionic framework website and as soon as i start a new project i get these errors.
I have tried many online solutions but none seem to work.
npm WARN deprecated tslint#6.1.2: TSLint has been deprecated in favor
of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm ERR! Unexpected end of JSON input while parsing near '...a512-0baf1FhCp16LhN+x'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Michel\AppData\Roaming\npm-cache\_logs\2020-06-07T00_38_37_180Z-debug.log
Open Windows Powershell as admin. Then run command:
npm cache clean --force
and then install ionic again as usual:
ionic start

"npm outdated" and "npm outdated -g" don't show anything so why am I getting these warnings of deprecations?

I have node.js version 12.16.3 (macOS x64), the most current LTS version. The npm version is 6.14.4, which comes as default with the node.js version already stated. My operating system is Catalina 10.15.4 (the latest version).
When I run npm outdated and npm outdated -g nothing is returned, I simply get a new line.
Yet when I run this inside of my project:
npm init followed by npm i --save-dev babel-cli babel-preset-env, I get these warnings:
npm WARN deprecated chokidar#1.7.0: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated core-js#2.6.11: core-js#<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js#3.
npm WARN deprecated fsevents#1.2.12: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
I have tried running npm install chokidar#^3 and I get the exact same warnings.
I have tried running npm install chokidar#latest and I get the exact same warnings.
I can't seem to update what I am being told to update. How can I resolve this issue?
Any help is much appreciated.

Angular ng new throwing error: npm ERR! Unexpected end of JSON input while parsing near

Im trying to create a new angular project, after writing 'ng new project', it starts downloading but then gives me this error:
Installing packages...npm WARN deprecated tslint#6.1.2: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.npm WARN deprecated fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to
fsevents 2.
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm ERR! Unexpected end of JSON input while parsing near '...EmGWKHtdKo\nmvJ5sCP6T'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\USER\AppData\Roaming\npm-cache\_logs\2020-05-13T09_41_32_733Z-debug.log
× Package install failed, see above.
does anyone know whats wrong? tnx
This happened due to you cache got corrupted. You need to clean your cache and re-install #angular/cli.
Open command prompt and run below commands.
npm cache clean --force
npm install -g #angular/cli

Resources