$ sudo apt-get install python-software-properties
$ curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -

添加PPA文件后,让安装NodeJS。

1. 安装nodejs相关环境

sudo apt install nodejs

2. 安装node包管理npm,及国内cnpm

sudo apt install npm
sudo npm install -g cnpm --registry=https://registry.npm.taobao.org
#升级 npm
cnpm install npm -g

# 升级或安装 cnpm
npm install cnpm -g

3. 利用cnpm 安装vue 和命令行工具 vue-cli

cnpm install vue
cnpm install --global vue-cli

4. vue-cli 命令行工具使用

# 全局安装 vue-cli
$ cnpm install --global vue-cli
# 创建一个基于 webpack 模板的新项目
$ vue init webpack my-project
# 这里需要进行一些配置,默认回车即可
This will install Vue 2.x version of the template.

5. 进入项目,安装并运行


$ cd my-project
$ cnpm install
$ cnpm run dev
 DONE  Compiled successfully in 4388ms

> Listening at http://localhost:8080

 

相关文章:

  • 2022-12-23
  • 2021-12-12
  • 2021-08-03
  • 2021-07-10
  • 2021-12-24
  • 2021-12-04
猜你喜欢
  • 2021-08-22
  • 2022-12-23
  • 2022-12-23
  • 2021-12-14
  • 2021-09-26
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案