(0)node -v
v19.9.0
brew uninstall node
edy@localhost ionicProject-ios % which node
/usr/local/bin/node
edy@localhost ionicProject-ios % sudo rm -rf /usr/local/bin/npm
sudo rm -rf /usr/local/share/man/man1/node.1
sudo rm -rf /usr/local/lib/dtrace/node.d
sudo rm -rf ~/.npm
sudo rm -rf ~/.node-gyp
sudo rm /usr/local/bin/node
Password:
edy@localhost ionicProject-ios % sudo rm -rf /usr/local/bin/npm
edy@localhost ionicProject-ios % sudo rm -rf /usr/local/share/man/man1/node.1
edy@localhost ionicProject-ios % sudo rm -rf /usr/local/lib/dtrace/node.d
edy@localhost ionicProject-ios % sudo rm -rf ~/.npm
edy@localhost ionicProject-ios % sudo rm -rf ~/.node-gyp
edy@localhost ionicProject-ios % sudo rm /usr/local/bin/node
(1)brew install node
(2)sudo n v12.14
(3) npm config set registry=https://registry.npm.taobao.org
npm install -g n
(4)项目中npm install ,需要删除node_modules文件夹
<一>运行环境,
- 运行在Mac电脑上,
1.Xcode目前对应的版本是12.5,
2.本地的nodejs 12.14,
3.node-sass 4.12.0,
- 安装nodejs
- 安装cnpm的淘宝镜像。
- npm install –g cnpm –registry=https://registry.npm.taobao.org.
- node 安装
sudo npm install –g n
sudo n v12.14
node –v
edy@localhost ionicProject-ios % npm install -g ionic
npm WARN deprecated ionic@5.4.16: The Ionic CLI now uses ✨ @ionic/cli ✨ for its package name! 👉 https://twitter.com/ionicframework/status/1223268498362851330
npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated superagent@4.1.0: Please upgrade to v7.0.2+ of superagent. We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing. See the releases tab for more information at https://github.com/visionmedia/superagent/releases.
npm WARN deprecated formidable@1.2.6: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau
/usr/local/bin/ionic -> /usr/local/lib/node_modules/ionic/bin/ionic
- ionic@5.4.16
- 运行在浏览器 ionic serve
- 打包
- ionic cordova platform add ios //删除platform/ios/下面的文件
- sudo ionic build ios
- 编译完成之后,打开svw_iip/ionicProject-ios/platforms/ios 下面的Simple.xcworkspace 然后双击打开,Xcode – project – Archive 类似截图这种下一步然后导出ipa. 或者上传的蒲公英或者自己网站https://www.pgyer.com/ 托管ipa下载。