CentOS 安装 vue 开发环境

最近在做一个手机端的项目,正好想用vue来实现,看了一下别人的效果还挺好的。

安装 node.js

安装前准备:
yum install libtool automake autoconf gcc-c++ openssl-devel

下载源码:
wget https://nodejs.org/dist/v6.9….

解压缩:
tar -zxvf node-v6.9.1.tar.gz

编译安装:
./configure –prefix=/app/server
make && make install

因为指定了安装目录,安装完成之后,需要把执行文件加到 /etc/profile 里才能全局使用。

安装 vue-cli 命令行工具

使用 npm 命令安装,依赖 node.js 环境,请先确认已经安装好了 node.js
以前很好奇,到底 npm 安装的东西到哪里去了?仔细一看,原来都在 node.js 的安装目录下 /app/server/nodejs/lib/node_modules

[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)

未完,待续。。。

    原文作者:大唐传奇
    原文地址: https://segmentfault.com/a/1190000007319118
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞