ubuntu安装vue

来源:互联网 发布:美工穿什么衣服 编辑:程序博客网 时间:2024/06/10 10:00
  • 需要nodejs
    我的电脑已经安装nodejs,但是我需要把它升级到最新稳定版
    node有一个模块叫n,是专门用来管理Node.js的版本的。

  • 首先 安装n模块

  npm install-g n
  • 第二步,升级
n stable
  • 安装vue
sudo npm install -g vue
  • 安装vue-cli 命令行工具
npm install -g vue-cli
  • 创建一个基于 webpack 模板的新项目
sudo vue init webpack my-project
  • 需要进行一些配置,默认回车即可
This will install Vue 2.x version of the template.For Vue 1.x use: vue init webpack#1.0 my-project? Project name my-project? Project description A Vue.js project? Author runoob <test@runoob.com>? Vue build standalone? Use ESLint to lint your code? Yes? Pick an ESLint preset Standard? Setup unit tests with Karma + Mocha? Yes? Setup e2e tests with Nightwatch? Yes   vue-cli · Generated "my-project".   To get started:     cd my-project     npm install     npm run dev
  • 按照上述提示
  sudo cd my-project  sudo  npm install  sudo npm run dev
原创粉丝点击