ionic and cordova not installing on windows

↘锁芯ラ 提交于 2019-12-24 07:06:04

问题


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


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/39779474/ionic-and-cordova-not-installing-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!