npm ERR while installing ionic - node.js

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

Related

ERRORS: Trying to install truffle to terminal

I'm completely new at this and keep getting an error message trying to install truffle. If I need to delete or add anything please explain in detail how to do so.
npm ERR! code ENOTEMPTY
npm ERR! syscall rename
npm ERR! path /Users/paulbrady/.npm-global/lib/node_modules/truffle
npm ERR! dest /Users/paulbrady/.npm-global/lib/node_modules/.truffle-f258BAu1
npm ERR! errno -66
npm ERR! ENOTEMPTY: directory not empty, rename '/Users/paulbrady/.npm-global/lib/node_modules/truffle' -> '/Users/paulbrady/.npm-global/lib/node_modules/.truffle-f258BAu1'
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/paulbrady/.npm/_logs/2021-05-19T09_32_00_700Z-debug.log
paulbrady#Pauls-MacBook-Air ~ %
I had similar issue and this is how I solved it
Remove the already installed truffle
sudo -i
cd /usr/local/lib/node_modules/
rm -r truffle .truffle_
Make sure Ganache is running first before reinstalling truffle again
Install Truffle: npm install -g truffle

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! 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.

Angular8 node js and npm installation problems

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.

Angular 2/4 npm install issue

When i try to to install angular via npm i get this error message:
npm install -g #angular/cli
npm ERR! path C:\Users\myname\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\acorn
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\myname\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\acorn' -> 'C:\Users\myname\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\.acorn.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\myname\AppData\Roaming\npm-cache\_logs\2017-07-26T15_20_28_022Z-debug.log
current setup:
node -v
v6.11.1
npm -v
5.3.0
VOILA!! I found the answer. Actually i can't claim that is a real answer to the problem but it worked damn well. So what i did is, i ran bash as administrator (i did this many times before but didn't worked), and i did next:
$npm cache verify (to see what will happen after i deleted some stuff, uncompleted angular package in node_modules directory for example)
$npm update ( update all outdated local packages )
$npm update -g ( update global packages )
$npm install -g #angular/cli
Maybe running bush as administrator wasn't necessary, maybe just npm update was enough. Anyway, i hope this solution will be helpful to someone.

Resources