{"id":51437,"date":"2024-10-08T18:36:13","date_gmt":"2024-10-08T10:36:13","guid":{"rendered":"https:\/\/server.hk\/cnblog\/51437\/"},"modified":"2024-11-14T10:43:16","modified_gmt":"2024-11-14T02:43:16","slug":"ubuntu-16-04-%e6%90%ad%e5%bb%ba-ionic-%e9%96%8b%e7%99%bc%e7%92%b0%e5%a2%83","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/51437\/","title":{"rendered":"Ubuntu 16.04 \u642d\u5efa ionic \u958b\u767c\u74b0\u5883"},"content":{"rendered":"<h1 id=\"ubuntu-16-04-%e6%90%ad%e5%bb%ba-ionic-%e9%96%8b%e7%99%bc%e7%92%b0%e5%a2%83-mqmoBoCwwj\">Ubuntu 16.04 \u642d\u5efa Ionic \u958b\u767c\u74b0\u5883<\/h1>\n<p>\u5728\u7576\u4eca\u7684\u79fb\u52d5\u61c9\u7528\u958b\u767c\u4e2d\uff0cIonic \u4f5c\u70ba\u4e00\u500b\u6d41\u884c\u7684\u958b\u6e90\u6846\u67b6\uff0c\u70ba\u958b\u767c\u8005\u63d0\u4f9b\u4e86\u4fbf\u6377\u7684\u5de5\u5177\u4f86\u69cb\u5efa\u8de8\u5e73\u53f0\u7684\u61c9\u7528\u3002\u672c\u6587\u5c07\u6307\u5c0e\u60a8\u5982\u4f55\u5728 Ubuntu 16.04 \u4e0a\u642d\u5efa Ionic \u958b\u767c\u74b0\u5883\uff0c\u8b93\u60a8\u80fd\u5920\u5feb\u901f\u958b\u59cb\u958b\u767c\u60a8\u7684\u61c9\u7528\u3002<\/p>\n<h2 id=\"%e5%89%8d%e7%bd%ae%e6%a2%9d%e4%bb%b6-mqmoBoCwwj\">\u524d\u7f6e\u689d\u4ef6<\/h2>\n<p>\u5728\u958b\u59cb\u4e4b\u524d\uff0c\u60a8\u9700\u8981\u78ba\u4fdd\u60a8\u7684\u7cfb\u7d71\u5df2\u7d93\u5b89\u88dd\u4e86\u4ee5\u4e0b\u8edf\u4ef6\uff1a<\/p>\n<ul>\n<li>Node.js<\/li>\n<li>NPM\uff08Node Package Manager\uff09<\/li>\n<li>Git<\/li>\n<\/ul>\n<h2 id=\"%e5%ae%89%e8%a3%9d-node-js-%e5%92%8c-npm-mqmoBoCwwj\">\u5b89\u88dd Node.js \u548c NPM<\/h2>\n<p>Node.js \u662f Ionic \u7684\u57fa\u790e\uff0c\u60a8\u53ef\u4ee5\u901a\u904e\u4ee5\u4e0b\u6b65\u9a5f\u5728 Ubuntu 16.04 \u4e0a\u5b89\u88dd Node.js \u548c NPM\uff1a<\/p>\n<pre><code>sudo apt update\nsudo apt install nodejs npm<\/code><\/pre>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6aa2\u67e5 Node.js \u548c NPM \u7684\u7248\u672c\uff1a<\/p>\n<pre><code>node -v\nnpm -v<\/code><\/pre>\n<h2 id=\"%e5%ae%89%e8%a3%9d-ionic-cli-mqmoBoCwwj\">\u5b89\u88dd Ionic CLI<\/h2>\n<p>\u63a5\u4e0b\u4f86\uff0c\u60a8\u9700\u8981\u5b89\u88dd Ionic CLI\uff08\u547d\u4ee4\u884c\u754c\u9762\uff09\uff0c\u9019\u662f\u958b\u767c Ionic \u61c9\u7528\u7684\u4e3b\u8981\u5de5\u5177\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u9032\u884c\u5b89\u88dd\uff1a<\/p>\n<pre><code>sudo npm install -g @ionic\/cli<\/code><\/pre>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6aa2\u67e5 Ionic CLI \u7684\u7248\u672c\uff1a<\/p>\n<pre><code>ionic -v<\/code><\/pre>\n<h2 id=\"%e5%ae%89%e8%a3%9d-cordova-mqmoBoCwwj\">\u5b89\u88dd Cordova<\/h2>\n<p>Ionic \u6846\u67b6\u4f9d\u8cf4\u65bc Cordova \u4f86\u8a2a\u554f\u539f\u751f\u8a2d\u5099\u529f\u80fd\uff0c\u56e0\u6b64\u60a8\u9700\u8981\u5b89\u88dd Cordova\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u9032\u884c\u5b89\u88dd\uff1a<\/p>\n<pre><code>sudo npm install -g cordova<\/code><\/pre>\n<h2 id=\"%e5%89%b5%e5%bb%ba-ionic-%e9%a0%85%e7%9b%ae-mqmoBoCwwj\">\u5275\u5efa Ionic \u9805\u76ee<\/h2>\n<p>\u73fe\u5728\uff0c\u60a8\u5df2\u7d93\u6210\u529f\u5b89\u88dd\u4e86\u6240\u6709\u5fc5\u8981\u7684\u5de5\u5177\uff0c\u63a5\u4e0b\u4f86\u53ef\u4ee5\u5275\u5efa\u4e00\u500b\u65b0\u7684 Ionic \u9805\u76ee\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4f86\u5275\u5efa\u4e00\u500b\u65b0\u7684\u9805\u76ee\uff1a<\/p>\n<pre><code>ionic start myApp blank<\/code><\/pre>\n<p>\u9019\u5c07\u5275\u5efa\u4e00\u500b\u540d\u70ba &#8220;myApp&#8221; \u7684\u65b0\u9805\u76ee\uff0c\u4e26\u4f7f\u7528\u7a7a\u767d\u6a21\u677f\u3002\u9032\u5165\u9805\u76ee\u76ee\u9304\uff1a<\/p>\n<pre><code>cd myApp<\/code><\/pre>\n<h2 id=\"%e9%81%8b%e8%a1%8c-ionic-%e6%87%89%e7%94%a8-mqmoBoCwwj\">\u904b\u884c Ionic \u61c9\u7528<\/h2>\n<p>\u5728\u9805\u76ee\u76ee\u9304\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u904b\u884c Ionic \u61c9\u7528\uff1a<\/p>\n<pre><code>ionic serve<\/code><\/pre>\n<p>\u9019\u5c07\u555f\u52d5\u4e00\u500b\u672c\u5730\u958b\u767c\u4f3a\u670d\u5668\uff0c\u4e26\u5728\u9ed8\u8a8d\u700f\u89bd\u5668\u4e2d\u6253\u958b\u61c9\u7528\u3002\u60a8\u53ef\u4ee5\u5728\u700f\u89bd\u5668\u4e2d\u67e5\u770b\u61c9\u7528\u7684\u5373\u6642\u8b8a\u66f4\u3002<\/p>\n<h2 id=\"%e5%ae%89%e8%a3%9d%e5%85%b6%e4%bb%96%e4%be%9d%e8%b3%b4-mqmoBoCwwj\">\u5b89\u88dd\u5176\u4ed6\u4f9d\u8cf4<\/h2>\n<p>\u6839\u64da\u60a8\u7684\u61c9\u7528\u9700\u6c42\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u5b89\u88dd\u5176\u4ed6\u4f9d\u8cf4\uff0c\u4f8b\u5982 Angular \u6216\u5176\u4ed6\u63d2\u4ef6\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528 NPM \u4f86\u5b89\u88dd\u9019\u4e9b\u4f9d\u8cf4\uff1a<\/p>\n<pre><code>npm install <\/code><\/pre>\n<h2 id=\"%e7%b8%bd%e7%b5%90-mqmoBoCwwj\">\u7e3d\u7d50<\/h2>\n<p>\u5728\u672c\u6587\u4e2d\uff0c\u6211\u5011\u4ecb\u7d39\u4e86\u5982\u4f55\u5728 Ubuntu 16.04 \u4e0a\u642d\u5efa Ionic \u958b\u767c\u74b0\u5883\u3002\u901a\u904e\u5b89\u88dd Node.js\u3001NPM\u3001Ionic CLI \u548c Cordova\uff0c\u60a8\u53ef\u4ee5\u5feb\u901f\u958b\u59cb\u958b\u767c\u8de8\u5e73\u53f0\u7684\u79fb\u52d5\u61c9\u7528\u3002\u5982\u679c\u60a8\u9700\u8981\u7a69\u5b9a\u7684\u4f3a\u670d\u5668\u4f86\u90e8\u7f72\u60a8\u7684\u61c9\u7528\uff0c\u8003\u616e\u4f7f\u7528\u6211\u5011\u7684 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u89e3\u6c7a\u65b9\u6848\uff0c\u63d0\u4f9b\u9ad8\u6548\u80fd\u548c\u53ef\u9760\u6027\uff0c\u52a9\u60a8\u9806\u5229\u904b\u884c\u60a8\u7684\u9805\u76ee\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b78\u7fd2\u5982\u4f55\u5728 Ubuntu 16.04 \u4e0a\u642d\u5efa Ionic \u958b\u767c\u74b0\u5883\uff0c\u5feb\u901f\u958b\u59cb\u958b\u767c\u9ad8\u6548\u7684\u8de8\u5e73\u53f0\u61c9\u7528\u7a0b\u5f0f\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4924],"tags":[],"class_list":["post-51437","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/51437","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=51437"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/51437\/revisions"}],"predecessor-version":[{"id":51438,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/51437\/revisions\/51438"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=51437"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=51437"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=51437"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}