博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Vue疑难杂症
阅读量:4706 次
发布时间:2019-06-10

本文共 3308 字,大约阅读时间需要 11 分钟。

安装Vue脚手架的时候

指令:npm install vue-cli -g

Microsoft Windows [版本 6.1.7601]版权所有 (c) 2009 Microsoft Corporation。保留所有权利。C:\Users\Administrator>npm install vue-cli -gnpm WARN deprecated coffee-script@1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)C:\Users\Administrator\AppData\Roaming\npm\vue -> C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\bin\vueC:\Users\Administrator\AppData\Roaming\npm\vue-init -> C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\bin\vue-initC:\Users\Administrator\AppData\Roaming\npm\vue-list -> C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\bin\vue-list+ vue-cli@2.9.6added 4 packages from 1 contributor, removed 389 packages and updated 235 packages in 251.71sC:\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? (recommended) 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 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# Project initialization finished!# ========================To get started:  cd test-2vlft  npm run devDocumentation 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 下载 webpackcmd 执行以下命令cnpm install webpack -gcnpm 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 等待,即打包完成

 

 

转载于:https://www.cnblogs.com/yingyigongzi/p/10740639.html

你可能感兴趣的文章
Seven Python Tools All Data Scientists Should Know How to Use
查看>>
cocos2d-x学习之路(二)——分析AppDelegate和HelloWorldScene文件
查看>>
Asp.net 对于服务器控件添加Client端方法
查看>>
在Salesforce中创建Approval Process
查看>>
NFS服务搭建与配置
查看>>
python计算文件md5值
查看>>
android 4.1 Emulator Skins
查看>>
Web站点防注入注意事项(转)
查看>>
第0次作业
查看>>
广播接收器——接收系统广播
查看>>
亿能测试资讯_2013-8-11
查看>>
北京地铁月度消费总金额计算(Python版)
查看>>
nginx+tomcat配置https
查看>>
[hadoop]备份
查看>>
C#中的委托和事件(续)
查看>>
python--MySql
查看>>
机器学习 - pycharm, pyspark, spark集成篇
查看>>
mysql explain 中key_len的计算
查看>>
实验一
查看>>
Linux内核--网络栈实现分析(九)--传输层之UDP协议(下)
查看>>