当前位置:网站首页>安装Nuxt.js时出现错误:TypeError:Cannot read property ‘eslint‘ of undefined
安装Nuxt.js时出现错误:TypeError:Cannot read property ‘eslint‘ of undefined
2022-07-30 05:38:00 【小鸽子。】
刚开始学习Nuxt.js,安装的时候,频频出现错误,尤其时客户端(Client)运行失败多次,有一次客户端服务端都失败。
错误如下:
cdm显示的ERROR是:
TypeError:Cannot read property ‘eslint’ of undefined.
查找了资料,发现可能是babel版本太low,也可能是依赖的问题。
最后我把nuxt文件夹下的node_modules文件给删了,重新下载。
删除node_modules后,执行命令:
npm install
重新下载node_modules.
然后打开nuxt.config.js,将其中的“isClient",修改成”Client".
即,原本如下:
extend (config, ctx) {
if (ctx.isClient) {
config.module.rules.push({
enforce: 'pre',
test: /\.(js|vue)$/,
loader: 'eslint-loader',
exclude: /(node_modules)/
})
}
}
修改后:
extend (config, ctx) {
if (ctx.Client) {
config.module.rules.push({
enforce: 'pre',
test: /\.(js|vue)$/,
loader: 'eslint-loader',
exclude: /(node_modules)/
})
}
}
再重新运行即可。

边栏推荐
猜你喜欢
随机推荐
[GStreamer] The name of the plugin should match GST_PLUGIN_DEFINE
75. 颜色分类
839. Simulated heap
腾讯面试居然跟我扯了半小时的CountDownLatch
如何使用FirewallD限制网络访问
PyCharm usage tutorial (more detailed, picture + text)
2022年SQL经典面试题总结(带解析)
瑞吉外卖项目:新增菜品与菜品分页查询
Basic syntax of MySQL DDL and DML and DQL
JVM 类加载机制 超详细学习笔记(三)
Thymeleaf简介
[GO语言基础] 一.为什么我要学习Golang以及GO语言入门普及
Navicat new database
The Golden Circle Rule: Deep Thinking Methods for Successful People
手把手教你彻底卸载MySQL
2022年SQL大厂高频实战面试题(详细解析)
机器学习—梯度下降Gradient Descent Optimization—c语言实现
分布式事务之 Seata框架的原理和实战使用(三)
php数组实现根据某个键值将相同键值合并生成新二维数组的方法
MySQL (2)





![[Mysql] DATEDIFF function](/img/cd/7d19e668701cdd5542b6e43f4c2ad4.png)



