zoukankan      html  css  js  c++  java
  • vue.js2.0新手笔记(一)——安装

      知道vue很长时间了,一直只是了解,没有深入学习,也没做什么具体的东西。现在有时间了,决定重头好好学一下,就从安装开始吧。

    一、安装node

      vue是用npm安装,npm是node的一个包管理工具,所以要下载node。

    二、安装命令行工具

      Windows系统需要安装一个命令行工具,可以用git。

    三、安装vue

      1、建一个文件夹存放你的vue项目,在当前文件夹下右键,选git bash here;

      2、全局安装webpack:在命令行中输入  

    npm install webpack -g

      3、安装vue脚手架:在命令行中输入 

    npm install vue-cli -g

      4、创建一个基于 webpack 模板的新项目monitor:在命令行中输入 

    vue init webpack monitor

        注:在这步会出现一些设置内容,其中“use ESlint……?”最好选no,否则代码检测会非常严格,多个空格都不行。

        

      5、安装依赖:

         cd my-project
         npm install
         npm run dev

    四、关于报错

      1、can not find xxx

      can not find xxx之类的报错是最常见的,解决方法就是“缺啥补啥”,在命令行输入npm install xxx就可以啦。(这种错误可能会出现很多,一个一个install就行了)

      2、8080端口被占用

      vue默认用8080端口,若被占用有两种解决方法。

      ①打开cmd查看端口占用情况:netstat -ano;

       ctrl+shift+esc打开任务管理器,结束占用80端口的进程。

      ②可在config中的index.js中改默认端口。

      3、其他错误

      可以先在网上查一下,若是一直解决不了的奇葩错误,建议重头再来。

  • 相关阅读:
    【基础算法】- 全排列
    【基础算法】- 2分查找
    区块链培训
    Static Binding (Early Binding) vs Dynamic Binding (Late Binding)
    test
    No data is deployed on the contract address!
    "throw" is deprecated in favour of "revert()", "require()" and "assert()".
    Variable is declared as a storage pointer. Use an explicit "storage" keyword to silence this warning.
    京都行
    Failed to write genesis block: database already contains an incompatible
  • 原文地址:https://www.cnblogs.com/MaiJiangDou/p/6423579.html
Copyright © 2011-2022 走看看