Could not install : npm install - g cordova ionic



I’m completely lost. I can not install ionic.

When I do : C:\Travail\AppIonic>npm install - g cordova ionic

I obtain :
C:\Travail\AppIonic\Meteobourse>npm install - g cordova ionic
npm ERR! addLocal Could not install C:\Travail\AppIonic\Meteobourse-
npm ERR! Windows_NT 10.0.14393
npm ERR! argv “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js” “install” “-” “g” “cordova” "ionic"
npm ERR! node v6.9.1
npm ERR! npm v3.10.8
npm ERR! path C:\Travail\AppIonic\Meteobourse-
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open

npm ERR! enoent ENOENT: no such file or directory, open 'C:\Travail\AppIonic\Meteobourse-'
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Travail\AppIonic\Meteobourse-'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR! C:\Travail\AppIonic\Meteobourse\npm-debug.log

I have try to upgrade node in v7.2.0. But the problem is same.
I have try to upgrade npm in v4.0.3. But the problem is same too :frowning:

What can I do ? Thank you for your help


Use the stable LTS of Nodejs, which I think is 6.9.1. Once you have that, install npm 3.10.10. Then clean your npm cache. Then you should be ok. Don’t mess with Node 7 or npm 4 yet. They are new, there are known issues, and npm 4 in particular introduces breaking changes to a lot of builds.


Thanks a lot for your help. I did everything as requested but here is what I get:

C:\Travail\AppIonic>npm install -g cordova ionic
npm WARN deprecated node-uuid@1.4.7: use uuid module instead
C:\Users\xxx\AppData\Roaming\npm\cordova -> C:\Users\xxx\AppData\Roaming\npm\node_modules\cordova\bin\cordova
C:\Users\xxx\AppData\Roaming\npm\ionic -> C:\Users\xxx\AppData\Roaming\npm\node_modules\ionic\bin\ionic
±- cordova@6.4.0
`-- ionic@2.1.13

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.0.15 (node_modules\ionic\node_modules\ionic-app-lib\node_modules\glob-watcher\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.0.15: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“win32”,“arch”:“x64”})

And if I try to run the programm with “ionic serve” I get:

Caught exception:
Error: Cannot find module 'ionic-app-lib’
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (C:\Users\xxx\AppData\Roaming\npm\node_modules\ionic\lib\cli.js:2:19)
at Module._compile (module.js:570:32)
at Object.Module._extensions…js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
Mind letting us know?


Those warnings are not a big deal. It looks as though your ionic installed “fine.” But if you are having that module error when trying to ionic serve one of the starting templates, then you might have something left over from the old bad install. Uninstall everything, making sure that npm’s node-modules folder is gone. (I once had to physically drop one in the trash when upgrading from one beta to another.) Then reinstall from scratch, starting with Nodejs.


It’s working !!!
Thanks a lot

To help beginners like me, here are the commands to uninstall Codova and ionic:

npm uninstall -g ionic
npm uninstall -g cordova