Error when attempting to create a new ionic project?

When I try to create an ionic project I get this error:

Error: Cannot find module 'config-chain'
at Function.Module._resolveFilename (module.js:337:15)
at Function.Module._load (module.js:287:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object.<anonymous> (/Users/Taylor/.npm-packages/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/ionic-cordova-lib/node_modules/npm/lib/config/core.js:2:10)
at Module._compile (module.js:425:26)
at Object.Module._extensions..js (module.js:432:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)

Cannot find module 'config-chain' (CLI v1.7.10)

Your system information:

Cordova CLI: Not installed
Ionic CLI Version: 1.7.10
Ionic App Lib Version: 0.6.5
ios-deploy version: Not installed
ios-sim version: 5.0.3 
OS: Mac OS X El Capitan
Node Version: v5.0.0
Xcode version: Xcode 7.1.1 Build version 7B1005 

Apparently, cordova isn’t installing, but I don’t know why. I’ve tried running npm install -g cordova several times but it keeps telling me that cordova isn’t installed.

Any ideas what the problem might be and how I can fix it?

Are you creating a v1 project or v2? What command are you running?

I think a v1 project. I’m running ionic start myApp.

Can you try installing Cordova with sudo? Is it giving you errors on the install of Cordova?

If you are running the command like ionic start myApp it is a v1 project. v2 requires a flag --v2.

Just tried installing Cordova with sudo.
I didn’t get an error on the install but I got the same error when I tried to run ionic start

Hmm can you create an issue for it and I’ll have someone look into it? Please :slight_smile:

1 Like

So, I tried running sudo ionic start myApp just to see if something was wrong with the permissions. I still got the same error but now it is saying that Cordova is installed.

Not sure, if this changes anything though.

Your system information:

Cordova CLI: 5.4.0
Ionic CLI Version: 1.7.10
Ionic App Lib Version: 0.6.5
ios-deploy version: Not installed
ios-sim version: 5.0.3 
OS: Mac OS X El Capitan
Node Version: v5.0.0
Xcode version: Xcode 7.1.1 Build version 7B1005 

Thanks @tanderson018 , I’m still unable to reproduce this, and trying to figure out where things are going wrong. It’s weird that upgrading or downgrading node or npm has fixed it for some people.

If you do npm cache clean and then reinstall ionic does that help?

Actually I’m going to close this to consolidate the issues, so if you could reply in Cannot find module ‘config-chain’ that would be excellent thanks!