开发前报错
1、zsh: command not found: vue
vue没有安装脚手架
先卸载以前的sudo npm uninstall -g vue-cli
脚手架的版本是对应的Node版本
所以先安装Node,例如安装1.6的Node(里面直接配带兼容npm的版本)
然后再安装脚手架sudo npm install vue-cli -g此时的脚手架是Cli4的
如果node1.2左右的,脚手架差不多是cli2.9
2、sh -c node install.js
在安装的时候添加一个参数--ignore-scripts--ignore-scripts表示npm将不会运行在package.json中指定的scripts脚本
npm install --save-dev electron --ignore-scripts
3、Node Sass does not yet support your current environment: OS X Unsupported architecture (arm64) with Unsupported runtime (93)
人需要逐渐提高自己解决问题的能力,请看我如何解它
当前的版本不支持此node sass 意味着你的node跟sass不匹配
那咱们就卸载
npm rebuild node-sass
npm uninstall node-sass
再装呗,此时看一下咱们的node版本为16,去查一下sass与node兼容版本https://github.com/sass/node-sass/releases
那就装7.0.1的呗,也可以装低一点版本的,但是要看文档
npm install sass-loader@7.0.1
npm install node-sass@7.0.1
开发中的报错
1、Fullpage.js version 3 has changed its license to GPLv3 and it requires a `licenseKey` option. Read about it here:
licenseKey: "OPEN-SOURCE-GPLv3-LICENSE"
V改v
2、css背景图片
background: url("~@/assets/images/s1.jpg") no-repeat center bottom;
3、eslint关闭
build/webpack.base.config文件下,以下代码注释
const createLintingRule = () => ({
// test: /\.(js|vue)$/,
// loader: 'eslint-loader',
// enforce: 'pre',
// include: [resolve('src'), resolve('test')],
// options: {
// formatter: require('eslint-friendly-formatter'),
// emitWarning: !config.dev.showEslintErrorsInOverlay
// }
})
开发后的报错
1、mui小图标找不到是因为路径问题,downloadable font: download failed
打包后css中引用字体的路径变成
dist/static/css/static/fonts/mui-icons-extra.683f395.ttf
这个路径不存在的
而字体文件实际在
dist/static/fonts/mui-icons-extra.683f395.ttf
我就把字体文件移动,手动创建打包后css中引用字体的路径
dist/static/css/static/fonts/mui-icons-extra.683f395.ttf
2、 "export 'users' was not found in './data.js'
export default 改为export
3、Object(...) is not a function
import 导入出现问题
如果报错中有vuex 注意也许是vuex安装有问题