Vue疑难杂症
安装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疑难杂症的更多相关文章
- vue生命周期探究(一)
前言 在使用vue开发的过程中,我们经常会接触到生命周期的问题.那么你知道,一个标准的工程项目中,会有多少个生命周期勾子吗?让我们来一起来盘点一下: 根组件实例:8个 (beforeCreate.cr ...
- vue状态管理vuex从浅入深详细讲解
1.vuex简介以及创建一个简单的仓库 vuex是专门为vue框架而设计出的一个公共数据管理框架,任何组件都可以通过状态管理仓库数据沟通,也可以统一从仓库获取数据,在比较大型的应用中,数据交互庞大的情 ...
- vue使用videojs控制后台m3u8数据请求
关于Video.js的使用方法就不再说了,有兴趣的请迁跃:https://videojs.com/ VideoJS中并没有stop之类控制后台数据请求的参数,只有暂停 video.pause()方法 ...
- 京东云开发者|关于“React 和 Vue 该用哪个”我真的栓Q
一.前言:我全都要 面对当今前端界两座大山一样的主流框架,React和Vue,相信很多小伙伴都或多或少都产生过这样疑问,而这样的问题也往往很让人头疼和犹豫不决: 业务场景中是不是团队用什么我就用什么? ...
- Vue.js 和 MVVM 小细节
MVVM 是Model-View-ViewModel 的缩写,它是一种基于前端开发的架构模式,其核心是提供对View 和 ViewModel 的双向数据绑定,这使得ViewModel 的状态改变可以自 ...
- wepack+sass+vue 入门教程(三)
十一.安装sass文件转换为css需要的相关依赖包 npm install --save-dev sass-loader style-loader css-loader loader的作用是辅助web ...
- wepack+sass+vue 入门教程(二)
六.新建webpack配置文件 webpack.config.js 文件整体框架内容如下,后续会详细说明每个配置项的配置 webpack.config.js直接放在项目demo目录下 module.e ...
- wepack+sass+vue 入门教程(一)
一.安装node.js node.js是基础,必须先安装.而且最新版的node.js,已经集成了npm. 下载地址 node安装,一路按默认即可. 二.全局安装webpack npm install ...
- Vue + Webpack + Vue-loader 系列教程(2)相关配置篇
原文地址:https://lvyongbo.gitbooks.io/vue-loader/content/ 使用预处理器 在 Webpack 中,所有的预处理器需要和一个相应的加载器一同使用.vue- ...
随机推荐
- Filter需要配置多个url-pattern
最近做项目遇到一个Filter需要配置多个url-pattern,上网查了下资料,经测试,现总结下 filter-mapping元素位于web.xml文件中filter元素之后serlvet元素之前. ...
- 微软Windows10LTSC2019官方三月更新版镜像
何谓 Windows 10 LTSC?其实,LTSC 是 Long Term Support Channel 的缩写,翻译一下就是“长期服务分支”. Windows 10 LTSC 实际上就是微软官方 ...
- 易混HTML Entities与正确用法
在页面上,表示HTML实体有多种方式,比方有"&+name;"."&#+10进制ID"."&#x+16进制ID".而 ...
- Python判断列表是否已排序的各种方法及其性能分析
目录 Python判断列表是否已排序的各种方法及其性能分析 声明 一. 问题提出 二. 代码实现 2.1 guess 2.2 sorted 2.3 for-loop 2.4 all 2.5 numpy ...
- Qt编写视频监控画面分割界面(开源)
其实qt应用在安防领域还是蛮多的,尤其是视频监控系统,但是网上几乎没有看到qt做的最基础的视频监控画面分割的demo,今天特意花几分钟提取出来,开源放出来.欢迎大家多多点赞!源码下载:点击打开链接 运 ...
- LeetCode - 503. Next Greater Element II
Given a circular array (the next element of the last element is the first element of the array), pri ...
- CSS实现自适应九宫格布局 大全
看到微博和朋友圈都实现了图片九宫格,曾经有次面试也问到了九宫格这个问题,当时想到的是先固定每个单元格的宽高,然后进行浮动.今天想折腾一下,实现自适应父元素宽度的布局.这次我只写了四种方式去实现九宫格, ...
- spring学习笔记-AOP
1.aop:aspect oriented programming 面向切面编程 2.aop在spring中的作用: 提供声明式服务(声明式事务) 允许用户实现自定义切面 3.aop:在不改变原有 ...
- Linux上配置http上网代理
有些局域网环境上网需要使用代理上网,图形界面的很好解决就设置一下浏览器的代理就好了,但是Linux纯命令行的界面就需要手动配置了. 如果要全局用户使用应用于所有的Shell,就需要修改 /etc/pr ...
- javascript的数组之filter()
filter()方法创建一个新数组,其包含通过回调函数测试的所有元素. const words = ['spray', 'limit', 'elite', 'exuberant', 'destruct ...