Problem while trying to start an ionic project - node.js

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

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

ERR while trying to download npm packages for VSCode

It´s my firts time working with Visual Studio Code and I tried to install npm packages that were alredy required in a project. But a bunch of errors that I have never seen showed up.
$ npm install
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 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 WARN deprecated left-pad#1.3.0: use String.prototype.padStart()
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.
I tried downloading Core-js,fsevents and chokidar but the same error showed up again and again.

Having trouble in creating a new Angular project

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:

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