最近在作一個手機端的項目,正好想用vue來實現,看了一下別人的效果還挺好的。vue
安裝前準備:
yum install libtool automake autoconf gcc-c++ openssl-develnode
下載源碼:
wget https://nodejs.org/dist/v6.9....c++
解壓縮:
tar -zxvf node-v6.9.1.tar.gzgit
編譯安裝:
./configure --prefix=/app/server
make && make installvue-cli
由於指定了安裝目錄,安裝完成以後,須要把執行文件加到 /etc/profile 裏才能全局使用。npm
使用 npm 命令安裝,依賴 node.js 環境,請先確認已經安裝好了 node.js
之前很好奇,到底 npm 安裝的東西到哪裏去了?仔細一看,原來都在 node.js 的安裝目錄下 /app/server/nodejs/lib/node_modulesjson
[app@devel vue.test.com]$ npm install -g vue-cli npm WARN engine vue-cli@2.4.0: wanted: {"node":">=4.0.0"} (current: {"node":"0.12.4","npm":"2.10.1"}) npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue /app/server/nodejs/bin/vue -> /app/server/nodejs/lib/node_modules/vue-cli/bin/vue vue-cli@2.4.0 /app/server/nodejs/lib/node_modules/vue-cli ├── uid@0.0.2 ├── semver@5.3.0 ├── commander@2.9.0 (graceful-readlink@1.0.1) ├── validate-npm-package-name@2.2.2 (builtins@0.0.7) ├── chalk@1.1.3 (escape-string-regexp@1.0.5, supports-color@2.0.0, ansi-styles@2.2.1, has-ansi@2.0.0, strip-ansi@3.0.1) ├── read-metadata@1.0.0 (yaml-js@0.0.8) ├── minimatch@3.0.3 (brace-expansion@1.1.6) ├── ora@0.2.3 (object-assign@4.1.0, cli-spinners@0.1.2, cli-cursor@1.0.2) ├── rimraf@2.5.4 (glob@7.1.1) ├── consolidate@0.14.1 (bluebird@3.4.6) ├── metalsmith@2.2.2 (is-utf8@0.2.1, absolute@0.0.1, win-fork@1.1.1, thunkify@2.1.2, has-generators@1.0.1, clone@0.1.19, stat-mode@0.2.2, is@2.2.1, async@0.9.2, unyield@0.0.1, ware@1.3.0, chalk@0.5.1, recursive-readdir@1.3.0, fs-extra@0.10.0, co-fs-extra@0.0.2, gray-matter@2.1.0) ├── handlebars@4.0.5 (async@1.5.2, source-map@0.4.4, optimist@0.6.1, uglify-js@2.7.4) ├── async@2.1.2 (lodash@4.16.4) ├── inquirer@0.12.0 (strip-ansi@3.0.1, ansi-regex@2.0.0, ansi-escapes@1.4.0, through@2.3.8, cli-width@2.1.0, rx-lite@3.1.2, lodash@4.16.4, run-async@0.1.0, cli-cursor@1.0.2, figures@1.7.0, string-width@1.0.2, readline2@1.0.1) ├── request@2.76.0 (is-typedarray@1.0.0, aws-sign2@0.6.0, forever-agent@0.6.1, oauth-sign@0.8.2, tunnel-agent@0.4.3, caseless@0.11.0, stringstream@0.0.5, isstream@0.1.2, json-stringify-safe@5.0.1, extend@3.0.0, aws4@1.5.0, node-uuid@1.4.7, qs@6.3.0, tough-cookie@2.3.2, combined-stream@1.0.5, form-data@2.1.1, mime-types@2.1.12, har-validator@2.0.6, http-signature@1.1.1, hawk@3.1.3) └── download-git-repo@0.2.1 (git-clone@0.1.0, download@4.4.3)
未完,待續。。。cookie