Angular8 node js and npm installation problems - node.js

I'm learning angular js. For this I've install nodejs and git. And I've run following command on CMD:
npm install -g #angular/cli#latest
After some time following error occurred
npm WARN rollback Rolling back #schematics/angular#8.3.21 failed (this is
probably harmless): EPERM: operation not permitted, lstat 'C:\Users\User
Name\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\#schematics'
npm ERR! code EEXIST
npm ERR! path C:\Users\User
Name\AppData\Roaming\npm\node_modules\#angular\cli\bin\ng
npm ERR! dest C:\Users\User Name\AppData\Roaming\npm\ng.ps1
npm ERR! EEXIST: file already exists, cmd shim 'C:\Users\Chaitanya
Kulkarni\AppData\Roaming\npm\node_modules\#angular\cli\bin\ng' ->
'C:\Users\Chaitanya Kulkarni\AppData\Roaming\npm\ng.ps1'
npm ERR! File exists: C:\Users\User Name\AppData\Roaming\npm\ng.ps1
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\User Name\AppData\Roaming\npm-cache\_logs\2020-01-
04T12_12_30_922Z-debug.log
Can you please explain what is that error and how I could solve this. I am using Window 10.

Perform following steps:
Completely uninstall angular-cli from your machine
npm uninstall -g angular-cli
Clean npm cache
npm cache clean --force
Reinstall angular cli,
npm i #angular/cli#latest -g

Run this commands and manually delete the exist files if does not work.
Completely uninstall angular-cli from your machine
npm uninstall -g angular-cli
Clean npm cache
npm cache clean --force
Reinstall angular cli,
npm i #angular/cli#latest -g
Delete this file going to the location.
C:\Users\Chaitanya Kulkarni\AppData\Roaming\npm\ng.ps1

You can try opening the Command Prompt with Administrator privileges and then run the command.

Try to run following command in terminal
npm install -g #angular/cli#latest --force

In the terminal navigate to the following path:
C:\Users\UserName\AppData\Roaming\npm\node_modules
and delete angular file and reinstall cli.
That worked for me.
Also do check if you've set your path variables correctly.

Related

npm ERR! cb() never called

I was trying to download expo cli and I got error:-
C:\WINDOWS\system32>npm i -g expo-cli
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! <https://github.com/npm/cli/issues>
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\HP\AppData\Local\npm-cache\_logs\2021-03-03T14_02_14_809Z-debug.log
I also used npm cache clean --force.
But it didn't work too😥
C:\WINDOWS\system32>npm -v
7.6.0
C:\WINDOWS\system32>node -v
v14.16.0
Please help me......
And after doing npm i -g npm it worked!!!!!!
But when I tried to install or download any packages then error:
E:\React-native\practice>npm i react-native-elements
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! <https://github.com/npm/cli/issues>
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\HP\AppData\Local\npm-cache\_logs\2021-03-04T05_03_20_067Z-debug.log
So what is wrong going on?
If you are using npm version 5 or above:
Try following command:
$ sudo npm cache verify
OR
$ sudo npm cache clean --force
I've had the same problem, and was able to fix it by adding the flag --legacy-peer-deps to the installation command. For instance:
npm i --legacy-peer-deps package-name
Run npm install -g npm & npm cache clean
I had the same problem and solved it with checking my proxxy settings in C:\Users\username.npmrc
here are the settings for the proxy.
proxy=...
https-proxy=...
strict-ssl=false
registry=...
You can set these things through npm with the following:
npm config set proxy ...
npm config set https-proxy ...
npm config set strict-ssl false
npm config set registry ...
Maybe you have to remove proxy and https-proxy to make it work.
I had the same problem in all npm package that I tried to download, and solved just running this command in my Windows CMD.
npm set strict-ssl true
You can try to force clean the npm cache
npm cache clean --force
I did the following steps:
delete node_modules
remove package-lock.json
run npm cache clean --force
run npm install --force
npm install --force was the key to success, because even after doing 1-2 steps, normal npm install resulted in same problem

npm install -g react-native-cli

Hello i'm trying to instal react native but on running npm install -g react-native-cli it brings the following error on Command Prompt.
npm ERR! code EINVAL
npm ERR! path C:\WINDOWS\system32\'C:\Users\User\AppData\Roaming\npm
npm ERR! Illegal characters in path.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\user\AppData\Local\npm-cache\_logs\2021-02-06T17_33_30_954Z-debug.log
try to clean cache
npm cache clean --force
then run
npm install -g react-native-cli
Or
delete your nodemodules folder
and then run
npm install -g react-native-cli
I also got this error:
npm ERR! EINVAL: invalid argument, utime
And was solved the issue with message:
By doing the following steps:
npm install -g npm#latest
cd your_project_directory
rmdir /s /q node_modules
npm install
That, basically upgrade the node package, then refresh the project's packages. Hope this brings down your error!

npm ERR while installing ionic

I am on Windows 10 trying to install Ionic. I ran the following code in the terminal:
npm install -g #ionic/CLI
And I get this error:
npm ERR! code EEXIST
npm ERR! path C:\Users\Lari\AppData\Roaming\npm\ionic.ps1
npm ERR! Refusing to delete C:\Users\Lari\AppData\Roaming\npm\ionic.ps1: is outside C:\Users\Lari\AppData\Roaming\npm\node_modules\#ionic\cli and not a link
npm ERR! File exists: C:\Users\Lari\AppData\Roaming\npm\ionic.ps1
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with force to overwrite files recklessly.
npm ERR! A complete log of this can be found in:
npm ERR! C:\Users\Lari\AppData\Roaming\npm-cache\_logs\2020-08-12T22_24_22_577Z-debug.log
I have ran the following commands to debug:
npm uninstall -g ionic
npm install -g #ionic/cli
npm install -g cordova #ionic/cli
and much more for over a week now.
I copied and paste this path in windows
C:\Users\Lari\AppData\Roaming\npm\ionic
Deleted all ionic folders, and then this path
C:\Users\Lari\AppData\Roaming\npm
Deleted some ionic files present as well.
Ran npm I -g #ionic/cli and it did install version 6.11.0.
Thanks everyone, hope it helps someone

Getting error while installing react-stripe-js in my react Project

Getting this error on trying to install npm install #stripe/react-stripe-js.
Can anyone help ?
C:\Users\Ayush\Desktop\ReactBootcamp\amazon-clone>npm install #stripe/react-stripe-js
npm ERR! Object for dependency "#babel/generator" is empty.
npm ERR! Something went wrong. Regenerate the package-lock.json with "npm install".
npm ERR! If using a shrinkwrap, regenerate with "npm shrinkwrap".
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Ayush\AppData\Roaming\npm-cache\_logs\2020-09-11T07_04_49_530Z-debug.log
enter image description here
try below steps
Delete node_modules folder
Delete package-lock.json file
run npm cache clean --force
npm install

npm ERR! Refusing to delete when Install react-native

I Have a Problem about NPM, I want to instal npm react-native with command npm install -g react-native-cli on cmd,
But, an error suddenly appeared like this :
npm ERR! path C:\Users\Xeon\AppData\Roaming\npm\react-native.cmd
npm ERR! code EEXIST
npm ERR! Refusing to delete C:\Users\Xeon\AppData\Roaming\npm\react-native.cmd: is outside C:\Users\Xeon\AppData\Roaming\npm\node_modules\react-native-cli and not a link
npm ERR! File exists: C:\Users\Xeon\AppData\Roaming\npm\react-native.cmd
npm ERR! Move it away, and try again.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Xeon\AppData\Roaming\npm-cache\_logs\2020-02-12T03_00_40_156Z-debug.log
I don't know why this error appears, hopefully I can find a solution here.
thank you
Check your npm/node version, make sure they install correctly
currently there's no need to install react-native-cli for RN 0.61
you should try
npx react-native init ProjectName
or just using expo instead
npm install -g expo-cli
expo init AwesomeProject
Lastly, you should read the Official Doc for more details.

Resources