Azhar Ch
Azhar Ch

Reputation: 61

ionic and cordova not installing on windows

i'm trying to install ionic but i'm failed to do that..i had install node.js but now these 2 things are not installing on my laptop. kindly help me as i don't know what to do in such condition. Following command i tried to use:

npm install -g cordova ionic
sudo npm install -g cordova ionic
npm install -g cordova 
npm install -g  ionic

ionic installation just stuck here for hours

Upvotes: 1

Views: 1726

Answers (2)

Yogesh Sanchihar
Yogesh Sanchihar

Reputation: 1118

To add to Sam5487 answer. If you are behind corporate proxy, then you should first these commands with appropriate changes.

  npm config set proxy http://proxy.company.com:8080
  npm config set https-proxy http://proxy.company.com:8080

Then

 npm install -g cordova

 npm install -g ionic

 ionic start <your app name>blank --type=ionic1

 ionic cordova platform add android

For web browser testing you can use

 ionic serve

After you are happy with your changes

 ionic build android

 ionic emulate android

All related information can be found at

https://jjasonclark.com/how-to-setup-node-behind-web-proxy/ https://ionicframework.com/docs/v1/guide/preface.html

Upvotes: 0

Sam5487
Sam5487

Reputation: 679

To start developing an ionic project:

Prereqs

Include Git for Windows for windows which is what I assume you are using based on the image in your question. After you install Git (and npm which you also stated was installed) go to the directory where you want to create the project and run the following.

  1. npm install -g cordova
  2. npm install -g ionic
  3. ionic start appName blank
  4. cd appName
  5. ionic platform add android
  6. ionic build android
  7. ionic emulate android

Also you can run in web browser using ionic serve or a web browser with iOS and Android using ionic serve --lab

If you want to emulate the Android device, make sure you have a system_image installed of the device you want. Guide here to do that.

EDIT:

Run npm --v and you should see the version you are running, if not then npm isn't installed correctly. Install it globally and run the process again.

Upvotes: 1

Related Questions