安装Vue脚手架的时候

指令:npm install vue-cli -g

Microsoft Windows [版本 6.1.7601]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。 C:\Users\Administrator>npm install vue-cli -g
npm WARN deprecated coffee-script@1.12.7: CoffeeScript on NPM has moved to "coff
eescript" (no hyphen)
C:\Users\Administrator\AppData\Roaming\npm\vue -> C:\Users\Administrator\AppData
\Roaming\npm\node_modules\vue-cli\bin\vue
C:\Users\Administrator\AppData\Roaming\npm\vue-init -> C:\Users\Administrator\Ap
pData\Roaming\npm\node_modules\vue-cli\bin\vue-init
C:\Users\Administrator\AppData\Roaming\npm\vue-list -> C:\Users\Administrator\Ap
pData\Roaming\npm\node_modules\vue-cli\bin\vue-list
+ vue-cli@2.9.6
added 4 packages from 1 contributor, removed 389 packages and updated 235 packag
es in 251.71s C:\Users\Administrator>

报了一个警告:如下

npm WARN deprecated coffee-script@1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)

解决办法(说明):coffee-script 这个依赖包xx的改名了,不影响你使用的,还有coffee-script已经过气了:)

初始化Vue项目的时候

vue init webpack test-2vlft

G:\sinoyd\personalProject>vue init webpack test-2vlft

? Project name test-2vlft
? Project description A Vue.js project
? Author xichaoqun <1593760568@qq.com>
? Vue build (Use arrow keys)
? Vue build standalone
? Install vue-router? Yes
? Use ESLint to lint your code? No
? Set up unit tests No
? Setup e2e tests with Nightwatch? No
? Should we run `npm install` for you after the project has been created? (recom
? Should we run `npm install` for you after the project has been created? (recom mended) npm vue-cli · Generated "test-2vlft". # Installing project dependencies ...
# ======================== npm WARN deprecated bfj-node4@5.3.1: Switch to the `bfj` package for fixes and n
ew features!
npm WARN deprecated browserslist@2.11.3: Browserslist 2 could fail on reading Br
owserslist >3.0 config used in other tools.
npm ERR! Unexpected end of JSON input while parsing near '...1PMB+NX2XCrirPUJC2m
A6' npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2019-04-20T0
5_10_15_943Z-debug.log # Project initialization finished!
# ======================== To get started: cd test-2vlft
npm run dev Documentation can be found at https://vuejs-templates.github.io/webpack

   警告+错误:


npm WARN deprecated bfj-node4@5.3.1: Switch to the `bfj` package for fixes and new features!
npm WARN deprecated browserslist@2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm ERR! Unexpected end of JSON input while parsing near '...1PMB+NX2XCrirPUJC2mA6' npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2019-04-20T05_10_15_943Z-debug.log
解决办法:
解决办法:
cnpm install (在安装淘宝镜像的前提下  npm install -g cnpm --registry=https://registry.npm.taobao.org cmd切入项目的所在目录,执行cnpm install)
例子: G:\sinoyd\personalProject\test-2vlft>cnpm install
安装Vue脚手架的时候

Vue项目打包
首先要 cnpm 下载 webpack

cmd 执行以下命令
cnpm install webpack -g
cnpm install webpack-cli -g

最后输入 webpack -v 弹出版本 表示安装成功

cmd 输入 cnpm install webpack -g  会报错 :

[fsevents@^1.2.7] optional install error: Package require os(darwin) not compati
ble with your platform(win32)

大致意思:这是一个可以忽略的错误,fsevents是可选的依赖,只能应用于maxOS系统,不适合Windows或者Linux,也就是忽略即可。

打包过程:先停止该Vue项目,cmd 输入 npm run build 等待,即打包完成

 

Vue疑难杂症的更多相关文章

  1. vue生命周期探究(一)

    前言 在使用vue开发的过程中,我们经常会接触到生命周期的问题.那么你知道,一个标准的工程项目中,会有多少个生命周期勾子吗?让我们来一起来盘点一下: 根组件实例:8个 (beforeCreate.cr ...

  2. vue状态管理vuex从浅入深详细讲解

    1.vuex简介以及创建一个简单的仓库 vuex是专门为vue框架而设计出的一个公共数据管理框架,任何组件都可以通过状态管理仓库数据沟通,也可以统一从仓库获取数据,在比较大型的应用中,数据交互庞大的情 ...

  3. vue使用videojs控制后台m3u8数据请求

    关于Video.js的使用方法就不再说了,有兴趣的请迁跃:https://videojs.com/ VideoJS中并没有stop之类控制后台数据请求的参数,只有暂停 video.pause()方法 ...

  4. 京东云开发者|关于“React 和 Vue 该用哪个”我真的栓Q

    一.前言:我全都要 面对当今前端界两座大山一样的主流框架,React和Vue,相信很多小伙伴都或多或少都产生过这样疑问,而这样的问题也往往很让人头疼和犹豫不决: 业务场景中是不是团队用什么我就用什么? ...

  5. Vue.js 和 MVVM 小细节

    MVVM 是Model-View-ViewModel 的缩写,它是一种基于前端开发的架构模式,其核心是提供对View 和 ViewModel 的双向数据绑定,这使得ViewModel 的状态改变可以自 ...

  6. wepack+sass+vue 入门教程(三)

    十一.安装sass文件转换为css需要的相关依赖包 npm install --save-dev sass-loader style-loader css-loader loader的作用是辅助web ...

  7. wepack+sass+vue 入门教程(二)

    六.新建webpack配置文件 webpack.config.js 文件整体框架内容如下,后续会详细说明每个配置项的配置 webpack.config.js直接放在项目demo目录下 module.e ...

  8. wepack+sass+vue 入门教程(一)

    一.安装node.js node.js是基础,必须先安装.而且最新版的node.js,已经集成了npm. 下载地址 node安装,一路按默认即可. 二.全局安装webpack npm install ...

  9. Vue + Webpack + Vue-loader 系列教程(2)相关配置篇

    原文地址:https://lvyongbo.gitbooks.io/vue-loader/content/ 使用预处理器 在 Webpack 中,所有的预处理器需要和一个相应的加载器一同使用.vue- ...

随机推荐

  1. 使用nginx搭建rtmp服务器

    一.软件需求 1.nginx源码包  下载地址:http://nginx.org/.笔者下载的是1.10.3. 2.pcre源码包.这是一个正则表达式库.nginx会用到这个开源库来做正则匹配.很多软 ...

  2. Spark性能优化指南-高级篇

    转自https://tech.meituan.com/spark-tuning-pro.html,感谢原作者的贡献 前言 继基础篇讲解了每个Spark开发人员都必须熟知的开发调优与资源调优之后,本文作 ...

  3. Spring-Cloud-Ribbon学习笔记(二):自定义负载均衡规则

    Ribbon自定义负载均衡策略有两种方式,一是JavaConfig,一是通过配置文件(yml或properties文件). 需求 假设我有包含A和B服务在内的多个微服务,它们均注册在一个Eureka上 ...

  4. js插件解读

    1.calendar.js:日期插件:2.html5shiv.js:用于解决IE9以下版本浏览器对HTML5新增标签不识别,并导致CSS不起作用的问题的js文件:3.jquery.js里的代码是没有进 ...

  5. 4依赖倒转原则DIP

    一.什么是倒转? 传统的过程式设计倾向于使高层次的模块依赖于低层次的模块,抽象层依赖 于具体的层次. 二.什么是依赖倒转原则 依赖倒转(Dependence Inversion Principle ) ...

  6. iOS - 提示用户升级版本并跳转到AppStore

    一.问题:自己做提示用户升级? 由于苹果做了自动升级,所有只要在应用程序中出现从AppStore检查版本更新,或者出现任何有关升级的提醒都会被拒,但是如果必须添加升级提示的话,可以配合后台通过添加AP ...

  7. Javascript 运行上下文和作用域链

    一.作用域Scope和上下文Context 在javascript中,作用域scope和上下文context是两个不同的概念.每个函数调用都会伴随着scope和context,从本质上来说,scope ...

  8. Keil不能跳转到函数的定义怎么办

    有时候我们右键一个函数名并点击Go To Definition Of xxx时,Keil却提示无法找到定义.但这个函数确实有定义的.这个时候可以试着重新编译整个工程,即可跳转到定义了.

  9. phpStudy apache 启动不了

    做  phpstudy 环境配置的时候,apache 一直启动不了,启动后又停止,80 端口也没有被占用,也下载了 vc9  运行库,还是不行,后来找了半天,中文路径的问题

  10. Web 自动化测试

    Selenium 名字的来源 在这里,我还想说一下关于 Selenium 名字的来源,很有意思的 : > : Selenium 的中文名为 “ 硒 ” ,是一种化学元素的名字,它 对 汞 ( M ...