Npm i -g ionic : failed


#1

Hi,

I try to install the last version of ionic and it failed. It is under windows !

Doe someone has an idea to fix it please ?

Here is the log

100608 warn In ionic@2.1.18 replacing bundled version of ionic-app-lib with ionic-app-lib@2.1.9
100609 verbose If you need help, you may report this error at:
100609 verbose https://github.com/npm/npm/issues
100610 verbose stack Error: ENOENT: no such file or directory, rename ‘C:\Users\Krys\AppData\Roaming\npm\node_modules.staging\ansi-7aaa5a45’ -> 'C:\Users\Krys\AppData\Roaming\npm\node_modules\ionic\node_modules\cordova-lib\node_modules\ansi’
100610 verbose stack at destStatted (C:\Users\Krys\AppData\Roaming\npm\node_modules\npm\lib\install\action\finalize.js:29:7)
100610 verbose stack at C:\Users\Krys\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\polyfills.js:276:29
100610 verbose stack at FSReqWrap.oncomplete (fs.js:123:15)
100610 verbose stack
100610 verbose stack Error: ENOENT: no such file or directory, rename ‘C:\Users\Krys\AppData\Roaming\npm\node_modules.staging\ansi-7aaa5a45’ -> 'C:\Users\Krys\AppData\Roaming\npm\node_modules\ionic\node_modules\cordova-lib\node_modules\ansi’
100610 verbose stack at Error (native)
100611 verbose cwd D:\SoClozeDev\Photogram - photogram2
100612 error Windows_NT 6.3.9600
100613 error argv “C:\Program Files\nodejs\node.exe” “C:\Users\Krys\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js” “i” “-g” "ionic"
100614 error node v6.9.1
100615 error npm v4.0.3
100616 error path C:\Users\Krys\AppData\Roaming\npm\node_modules.staging\ansi-7aaa5a45
100617 error code ENOENT
100618 error errno -4058
100619 error syscall rename
100620 error enoent ENOENT: no such file or directory, rename ‘C:\Users\Krys\AppData\Roaming\npm\node_modules.staging\ansi-7aaa5a45’ -> 'C:\Users\Krys\AppData\Roaming\npm\node_modules\ionic\node_modules\cordova-lib\node_modules\ansi’
100621 error enoent ENOENT: no such file or directory, rename ‘C:\Users\Krys\AppData\Roaming\npm\node_modules.staging\ansi-7aaa5a45’ -> 'C:\Users\Krys\AppData\Roaming\npm\node_modules\ionic\node_modules\cordova-lib\node_modules\ansi’
100621 error enoent This is most likely not a problem with npm itself
100621 error enoent and is related to npm not being able to find a file.
100622 verbose exit [ -4058, true ]


#2

had the same problem, try uninstalling then clearing npm cache and reinstalling


#3

Yes, as per @taljacobson said, first uninstall cordova and ionic by

npm uninstall -g cordova
npm uninstall -g ionic

and then reinstall

npm cache clean

make sure to update to latest npm (optional)

npm install -g npm OR npm install -g npm@latest

and finally

npm install -g cordova@latest
npm install -g ionic@latest
OR
npm install -g cordova ionic

once it’s done, check your ionic version to current ionic version by
ionic -v or ionic info


#4

Thanks a lot,

I already tried this … no way :frowning:


#5

I had the same problem. I had to uninstall Cordova as well as Ionic and now it works fine. See here


#6

Thanks Richards,

I will give a try :wink:


#7

Thanks to everybody,

It fix the issue :wink: