allen-mba:~ allen$ nvm install 6.9.1
Downloading and installing node v6.9.1...
Downloading https://nodejs.org/dist/v6.9.1/node-v6.9.1-darwin-x64.tar.gz...
######################################################################## 100.0%
Computing checksum with shasum -a 256
Checksums matched!
Now using node v6.9.1 (npm v3.10.8)
Creating default alias: default -> 6.9.1 (-> v6.9.1)
allen-mba:~ allen$ nvm install node
Downloading and installing node v9.2.0...
Downloading https://nodejs.org/dist/v9.2.0/node-v9.2.0-darwin-x64.tar.gz...
######################################################################## 100.0%
Computing checksum with shasum -a 256
Checksums matched!
Now using node v9.2.0 (npm v5.5.1)
nvm current
查詢目前所使用的Node.js版本
allen-mba:~ allen$ nvm current
v6.9.1
nvm use <version>
設定目前電腦要使用的Node.js版本,如下測試一開始的版本為v9.2.0透過指令nvm use 6.9.1,切換到所設定的版本
allen-mba:~ allen$ nvm current
v9.2.0
allen-mba:~ allen$ nvm use 6.9.1
Now using node v6.9.1 (npm v3.10.8)
allen-mba:~ allen$ nvm current
v6.9.1
allen-mba:~ allen$
allen-mba:~ allen$ cordova -v
? May Cordova anonymously report usage statistics to improve the tool over time? (Y/n)
You have been opted out of telemetry. To change this, run: cordova telemetry on.
6.5.0
檢查ionic安裝版本 ionic -v
allen-mba:~ allen$ ionic -v
******************************************************
Dependency warning - for the CLI to run correctly,
it is highly recommended to install/upgrade the following:
Install ios-sim to deploy iOS applications.`npm install -g ios-sim` (may require sudo)
Install ios-deploy to deploy iOS applications to devices. `npm install -g ios-deploy` (may require sudo)
******************************************************
2.2.3
allen-mba:~ allen$ sudo npm install -g ios-deploy --unsafe-perm=true
> ios-deploy@1.9.2 preinstall /Users/allen/.nvm/versions/node/v6.9.1/lib/node_modules/.staging/ios-deploy-c74a4967
> ./src/scripts/check_reqs.js && xcodebuild
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!! WARNING: You are on OS X 10.11 El Capitan or greater, you may need to add the
!!!! WARNING: `--unsafe-perm=true` flag when running `npm install`
!!!! WARNING: or else it will fail.
!!!! WARNING: link:
!!!! WARNING: https://github.com/phonegap/ios-deploy#os-x-1011-el-capitan
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
=== BUILD TARGET ios-deploy-lib OF PROJECT ios-deploy WITH THE DEFAULT CONFIGURATION (Release) ===
Check dependencies
Write auxiliary files
...
...
...
export variant=normal
/bin/sh -c /Users/allen/.nvm/versions/node/v6.9.1/lib/node_modules/.staging/ios-deploy-c74a4967/build/ios-deploy.build/Release/ios-deploy.build/Script-C0CD3D9B1F59DA8300F954DB.sh
** BUILD SUCCEEDED **
/Users/allen/.nvm/versions/node/v6.9.1/bin/ios-deploy -> /Users/allen/.nvm/versions/node/v6.9.1/lib/node_modules/ios-deploy/build/Release/ios-deploy
/Users/allen/.nvm/versions/node/v6.9.1/lib
└── ios-deploy@1.9.2
安裝 bower
執行指令 sudo npm install -g bower
allen-mba:~ allen$ sudo npm install -g bower
Password:
npm WARN deprecated bower@1.8.2: ...psst! Your project can stop working at any moment because its dependencies can change. Prevent this by migrating to Yarn: https://bower.io/blog/2017/how-to-migrate-away-from-bower/
/Users/allen/.nvm/versions/node/v6.9.1/bin/bower -> /Users/allen/.nvm/versions/node/v6.9.1/lib/node_modules/bower/bin/bower
/Users/allen/.nvm/versions/node/v6.9.1/lib
└── bower@1.8.2
檢查安裝版本 bower -v
allen-mba:~ allen$ bower -v
1.8.2
安裝 gulp
執行指令 sudo npm install -g gulp
allen-mba:~ allen$ sudo npm install -g gulp
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
/Users/allen/.nvm/versions/node/v6.9.1/bin/gulp -> /Users/allen/.nvm/versions/node/v6.9.1/lib/node_modules/gulp/bin/gulp.js
/Users/allen/.nvm/versions/node/v6.9.1/lib
└─┬ gulp@3.9.1
├── archy@1.0.0
...
...
...
├─┬ through2@0.6.5
│ └─┬ readable-stream@1.0.34
│ ├── isarray@0.0.1
│ └── string_decoder@0.10.31
└─┬ vinyl@0.4.6
└── clone@0.2.0
檢查安裝版本gulp -v
allen-mba:~ allen$ gulp -v
[14:33:29] CLI version 3.9.1
allen-mba:~ allen$ pod setup
Setting up CocoaPods master repo
$ /usr/bin/git clone https://github.com/CocoaPods/Specs.git master --progress
Cloning into 'master'...
remote: Counting objects: 1776874, done.
remote: Compressing objects: 100% (199/199), done.
remote: Total 1776874 (delta 89), reused 47 (delta 38), pack-reused 1776632
Receiving objects: 100% (1776874/1776874), 498.44 MiB | 2.35 MiB/s, done.
Resolving deltas: 100% (966806/966806), done.
Checking out files: 100% (201449/201449), done.
CocoaPods 1.4.0.beta.2 is available.
To update use: `sudo gem install cocoapods --pre`
[!] This is a test version we'd love you to try.
For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.4.0.beta.2
Setup completed
一定要執行pod setup,要不然在接著執行「npm run setup」的過程中,安裝套件「phonegap-plugin-push」時會出現以下的錯誤訊息
Installing "phonegap-plugin-push" for ios
Failed to install 'phonegap-plugin-push':undefined
Failed to restore plugin "phonegap-plugin-push" from config.xml. You might need to try adding it again. Error: The CocoaPods repo has not been synced yet, this will take a long time (approximately 500MB as of Sept 2016). Please run `pod setup` first to sync the repo.
有執行pod setup的話,會出現以下的訊息
Installing "phonegap-plugin-push" for ios
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 1085k 100 1085k 0 0 1987k 0 --:--:-- --:--:-- --:--:-- 1988k
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 1596k 100 1596k 0 0 2181k 0 --:--:-- --:--:-- --:--:-- 2181k
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 119k 100 119k 0 0 782k 0 --:--:-- --:--:-- --:--:-- 783k
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
98 1850k 98 1824k 0 0 1969k 0 --:--:-- --:--:-- --:--:-- 1967k
100 1850k 100 1850k 0 0 1979k 0 --:--:-- --:--:-- --:--:-- 1979k
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 13396 100 13396 0 0 141k 0 --:--:-- --:--:-- --:--:-- 142k
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 1171k 100 1171k 0 0 1749k 0 --:--:-- --:--:-- --:--:-- 1750k
Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.
Looked here: /Users/allen/Applications/Android/sdk/tools/templates/gradle/wrapper
allen-mba:tools allen$ android -h
Usage:
android [global options] action [action options]
Global options:
-s --silent : Silent mode, shows errors only.
-v --verbose : Verbose mode, shows errors, warnings and all messages.
--clear-cache: Clear the SDK Manager repository manifest cache.
-h --help : Help on a specific command.
Valid
actions
are
composed
of a verb
and an
optional
direct
object:
- sdk : Displays the SDK Manager window.
- avd : Displays the AVD Manager window.
- list : Lists existing targets or virtual devices.
- list avd : Lists existing Android Virtual Devices.
- list target : Lists existing targets.
- list device : Lists existing devices.
- list sdk : Lists remote SDK repository.
- create avd : Creates a new Android Virtual Device.
- move avd : Moves or renames an Android Virtual Device.
- delete avd : Deletes an Android Virtual Device.
- update avd : Updates an Android Virtual Device to match the folders
of a new SDK.
- create project : Creates a new Android project.
- update project : Updates an Android project (must already have an
AndroidManifest.xml).
- create test-project : Creates a new Android project for a test package.
- update test-project : Updates the Android project for a test package (must
already have an AndroidManifest.xml).
- create lib-project : Creates a new Android library project.
- update lib-project : Updates an Android library project (must already have
an AndroidManifest.xml).
- create uitest-project: Creates a new UI test project.
- update adb : Updates adb to support the USB devices declared in the
SDK add-ons.
- update sdk : Updates the SDK by suggesting new platforms to install
if available.
allen-mba:tools allen$