Vue-Element-Template学习问题记录

下载vue-admin-template-master项目之后,运行

1、npm install

2、npm dev run 

登录后台界面:

Vue-Element-Template学习问题记录_第1张图片

问题1:提示代理报错。

找了很多资料,基本上都是代理跨域的问题。最后发现npm install安装问题,重新执行,执行过程比较慢,如果卡住(请检查是否已经安装git,git安装:https://www.cnblogs.com/wj-1314/p/7993819.html),也有可能会报python错误,也需要安装python(https://baijiahao.baidu.com/s?id=1606573927720991570&wfr=spider&for=pc),问题解决。该模板一般来说是完整的,也不需要修改什么,报错基本上是由于环境问题。

问题2:进行npm install 报错(错误除了截图,还包括python的一大串错误(未截图))

输入npm install 报错[email protected] postinstall:`node scripts/build.js` Failed at the [email protected]

Vue-Element-Template学习问题记录_第2张图片

 解决方案:

这个是因为sass安装时获取源的问题,先修改sass安装的源,再运行npm install就成功了

npm config set sass_binary_site=https://npm.taobao.org/mirrors/node-sass

 未完待续,此文章为学习笔记,不定时更新,如有疑问,请联系。

 

相关知识拓展:

1、yarn安装:

Vue-Element-Template学习问题记录_第3张图片

npm 安装yarn

npm install -g yarn --registry=https://registry.npm.taobao.org

配置源:

yarn config set registry https://registry.npm.taobao.org -g yarn config set sass_binary_site http://cdn.npm.taobao.org/dist/node-sass -g

2、node项目生成方式:

1>、脚手架

  1. npm uninstall -g vue-cli //如需升级则先卸载
  2. npm install -g @vue/cli //升级
  3. vue create //文件名 不支持驼峰(含大写字母)

2>、 Cli-init

     1、npm install -g @vue/cli-init                 //安装完后 就还可以使用 vue init 命令

     2、vue init webpack vue_project或者vue init webpack-simple my-project

参考地址:

https://baijiahao.baidu.com/s?id=1606573927720991570&wfr=spider&for=pc

https://www.cnblogs.com/wj-1314/p/7993819.html

 

 

你可能感兴趣的:(问题记录)