How do I get rid of this angular error message - node.js

While trying to create a new project with angular, I used the command ng new my-dream-app in command prompt and I receiver the following error message:
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 fsevents#1.2.12: fsevents 1 will break on node v14+. Upgrade to fsevents 2 with massive improvements.
npm ERR! Unexpected end of JSON input while parsing near '...t-config-prettier":"^'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Izormen Onotieose\AppData\Roaming\npm-cache\_logs\2020-04-21T14_21_50_827Z-debug.log
× Package install failed, see above.
Pls how do I go about this?

It looks like it is a cache error. Try this:
npm cache clean --force
npm install -g #angular/cli
Cheers!

Try cleaning the cache and reinstalling global Angular CLI.
Open CMD as administrator and run
npm cache clean --force
npm install -g #angular/cli

Related

Error when running "npm install -g #vue/cli", reinstall attempted many times

I have been stuck on this for a long time. When i run npm install -g #vue/cli, it pops up the following error. simliar error occurs also when I run vue create project-name. I have tried reinstall many times and I have tried clean the cache as well. I am clear that the dictionary in the error " C:\Users\zhang\node_modules.bin/../node/bin/node" does not exist, but i have no idea how to fix it.
C:\Users\zhang>npm install -g #vue/cli
npm WARN deprecated #hapi/topo#3.1.6: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated #hapi/bourne#1.3.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated #hapi/address#2.1.4: Moved to 'npm install #sideway/address'
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated #hapi/hoek#8.5.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated #hapi/joi#15.1.1: Switch to 'npm install joi'
npm ERR! code 127
npm ERR! path C:\Users\zhang\AppData\Roaming\npm\node_modules\#vue\cli\node_modules\core-js-pure
npm ERR! command failed
npm ERR! command D:\Program Files\git\bin\bash.exe -c node -e "try{require('./postinstall')}catch(e){}"
npm ERR! /c/Users/zhang/node_modules/.bin/node: line 8: C:\Users\zhang\node_modules\.bin/../node/bin/node: No such file or directory
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\zhang\AppData\Local\npm-cache\_logs\2021-05-02T21_16_30_121Z-debug.log
I have been stuck on this for hours and I appreciate any help from you
Thank you !
The WARNs is not an issue.
It did fail to run node binaries.
npm ERR! /c/Users/zhang/node_modules/.bin/node: line 8: C:\Users\zhang\node_modules\.bin/../node/bin/node: No such file or directory
Make sure you get the right path. Or change the env PATH variable accordingly.
please follow any of these to avoid these
1.sett the Environment path correctly
2.make sure that current user has the permission to process the data
ls -la /usr/lib/node_modules
whoami
sudo chown -R $USER /usr/lib/node_modules(setting the permission to current user)
3.Install the npm as sudo user by
sudo npm i -g #vue/cli

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:

Getting error while installing parcel bundler in my node.js application in windows

Getting error while installing parcel-bundler using npm, my command is follows:
npm install -g parcel-bundler
Below is error description.
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 ERR! Unexpected end of JSON input while parsing near '...Fzsf0KuydGYbbeMJ+WVIy'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\warrior\AppData\Roaming\npm-cache_logs\2020-04-12T05_01_07_407Z-debug.log
Try first cleaning the cache:
npm clean-install

Angular and NPM issue

I'm currently learning angular 9 so when i tried to install node js and npm with latest version that is node version 12.* and npm version 6.14.*. I'm facing problem whith ng new and npm install command
Issues are as follows:
sudo npm install
npm WARN deprecated mkdirp#0.5.4: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! Unexpected end of JSON input while parsing near '...ure":"-----BEGIN PGP '
npm ERR! A complete log of this run can be found in:
npm ERR! /home/frustrated_coder/.npm/_logs/2020-03-29T14_31_40_275Z-debug.log
ng new angular-test
Installing packages...npm WARN deprecated mkdirp#0.5.4: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! Unexpected end of JSON input while parsing near '...200772","tarball":"ht'
npm ERR! A complete log of this run can be found in:
npm ERR! /home/frustrated_coder/.npm/_logs/2020-03-29T14_20_56_952Z-debug.log
✖ Package install failed, see above.
The Schematic workflow failed. See above.
Also i working on angular-electron but the majority of the problem is with that as well due to npm install command in it.
This is the https://github.com/maximegris/angular-electron url from where i'm cloning angular electron.
Use Windows Powershell as an administrator and run;
npm cache clean --force
npm install -g #angular/cli

npm WARN deprecated tslint#6.1.2: TSLint has been deprecated in favor of ESLint

when i run ng new it shows
\ 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
'...-grunt-tasks":"^4.0.0'
npm ERR! A complete log of this run can be found in:
npm ERR!
C:\Users\Abitech\AppData\Roaming\npm-cache_logs\2020-06-02T16_28_06_793Z-debug.log
× Package install failed, see above.
The Schematic workflow failed. See above.
npm cache clean --force
npm uninstall -g #angular/cli
npm install -g #angular/cli
ng new projectName
This worked for me
i had the exact same error so i followed these steps and then i was able to create a new project successfully
1) Run ( Win + R ) then type %AppData% , then clear the npm-cache folder , i.e delete that folder manually.
2) Then again run the command ng new project name
This worked for me :)
Just run:
npm cache clean --force
npm install -g #angular/cli#latest
npm cache verify
npm install npm#latest -g
Then:
ng new projectName
(...) TSLint has been deprecated in favor of ESLint.
If npm update tslint didn't help, you can install and use eslint instead.
Url: https://www.npmjs.com/package/eslint
1.Run npm cache clean --force
2.Manually delete npm and npm-cache folders from AppData/Roaming folder (Win + R, Type %AppData% and enter)
3.Run Node Installer and repair
4.Reinstall npm install -g #angular/cli
5.Rerun ng new newApp
Worked :)
Just delete npm-cache folder in 'C:\Users\User Name \AppData\Roaming'
and recreate project

Resources