一.vue问题记录
1. vue+elementui项目,build后在ie下报“Promise”未定义错误
// 1 安装 babel-polyfill 包
npm install babel-polyfill
// 2 找到 src/main.js 文件,在第一行引入 babel-polyfill
import "babel-polyfill"
// 3 重新编译即可
2. elementui,ie下icon不显示
在build->webpack.base.conf.js
中,修改limit
属性为0:
{
test: /\.(woff2?|woff|eot|ttf|otf)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 0, // 将小的,即低于limit的图片进行base64编码,以减少http请求。设置为0表示不错base64编码处理
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
}
}
3. npm run dev 时,报babel-runtime/core-js/… 错误
尝试重装组件,然后重新 npm run dev
npm install babel-runtime -D
4. npm run dev 时,Can’t find Python executable “python”, you can set the PYTHON…错误
用管理员方式运行cmd,运行下边命令:
cnpm install --global --production windows-build-tools
二.git问题记录
1.fatal: unable to access ‘https://github.com/…’: OpenSSL SSL_read: Connection was reset, errno 10054
解决方法:
(1) 尝试更换npm源
npm config set registry https://registry.npm.taobao.org
(1) 产生原因:一般是这是因为服务器的SSL证书没有经过第三方机构的签署,所以才报错。参考网上解决办法:解除ssl验证后,再次git即可
git config --global http.sslVerify "false"
三.npm报错问题
1.报错如:core-js/modules/es6…,原因是core-js版本太高
cnpm install core-js@2 -S
2.报错:Error: [vue-loader] vue-template-compiler must be installed as a peer dependency, or a compatible compiler implementation must be passed via options.
原因及解决方法:vue
和 vue-template-compiler
版本不一致,修改package.json
这两个包的版本号为一致,删除 node_modules
文件夹,重新执行 npm install
其他
解决方法:尝试清除npm缓存
删除package.lock.json文件
npm cache clean --force (会有警告提示,忽略即可)
npm install 重新安装