美文网首页
Vue.js环境搭建

Vue.js环境搭建

作者: hello12qwerz | 来源:发表于2020-06-11 23:17 被阅读0次

【1】node安装


安装好node, npm或者cnpm

node版本切换:

cnpm install -g n --force
n stable #切换到最新的稳定版本

【2】webpack安装

 cnpm install webpack -g

【3】vue-cli

cnpm install  vue-cli -g

【4】新建vue 工程

vue init webpack demo 出现如下错误:

➜  demo vue init webpack demo
/usr/local/lib/node_modules/vue-cli/bin/vue-init:60
let template = program.args[0]
^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:404:25)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Function.Module.runMain (module.js:457:10)
    at startup (node.js:136:18)
    at node.js:972:3

解决方法:Node版本过低导致:

n stable #切换node到最新的稳定版即可

重新执行即可。

相关文章

  • 2019-06-15

    Node.js、Vue.js 运行环境搭建记录 参考链接:Vue.js 运行环境搭建详解(基于windows的手把...

  • Vue.js环境搭建

    Vue.js环境搭建: 1.安装node.js https://nodejs.org/en/download/ ...

  • 在Intelij idea 环境下搭建vue.js环境

    有道云笔记链接: 在Intelij idea 环境下搭建vue.js环境 Node.js和npm 安装 Node....

  • 全栈的自我修养: 002使用@vue/cli进行vue.js环境

    全栈的自我修养: 使用@vue/cli进行vue.js环境搭建 Success, real success, is...

  • vue.js环境搭建

    在这个JS入侵前后端的形势下,不会JS的Androider不是好Androider,所以就从零来学习一下在前端大火...

  • vue.js 环境搭建

    npm 安装 检验安装 cnpm 安装 淘宝镜像:https://npm.taobao.org/ 检验安装 vue...

  • Vue.js环境搭建

    简述 小弟刚刚开始写博客,学习VueJs也不久,开这个博客,只是为了多多学习和记录自己的 学习之旅,可能很多地方...

  • vue.js 环境搭建

    一、安装node.js下载地址: http://nodejs.cn/download/ 二、安装npmnpm是no...

  • Vue.js环境搭建

    【1】node安装 略安装好node, npm或者cnpm node版本切换: 【2】webpack安装 【3】v...

  • Vue.js环境搭建

    第一步:安装node.js 官网地址:https://nodejs.org/zh-cn/历史版本:https://...

网友评论

      本文标题:Vue.js环境搭建

      本文链接:https://www.haomeiwen.com/subject/dxhwtktx.html