当前位置:网站首页>安装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)/
})
}
}
再重新运行即可。
边栏推荐
- 坠落的蚂蚁(北京大学考研机试题)
- 2022 SQL big factory high-frequency practical interview questions (detailed analysis)
- 839. 模拟堆
- [其他] DS5
- 解决没有配置本地nacos但是一直发生localhost8848连接异常的问题
- Redis学习
- WeChat payment and payment callback
- 【图像处理】基于中轴变换实现图像骨架提取附matlab代码
- JVM 内存结构 超详细学习笔记(一)
- [Redis Master Cultivation Road] Jedis - the basic use of Jedis
猜你喜欢
MySQL索引常见面试题(2022版)
St. Regis Takeaway Project: New dishes and dishes paged query
The use of Conluce, an online document management system
MYSQL-InnoDB的线程模型
cookie和session区别
Solve the problem that the local nacos is not configured but the localhost8848 connection exception always occurs
Memories · The last system design in the university era
2022年SQL大厂高频实战面试题(详细解析)
cnpm安装步骤
What is SOA (Service Oriented Architecture)?
随机推荐
【图像处理】基于中轴变换实现图像骨架提取附matlab代码
navicat无法连接mysql超详细处理方法
Machine Learning - Gradient Descent Optimization - C language implementation
手把手教你彻底卸载MySQL
Basic syntax of MySQL DDL and DML and DQL
This dependency was not found:
Solve the problem that the local nacos is not configured but the localhost8848 connection exception always occurs
分布式事务之 Seata框架的原理和实战使用(三)
cookie和session区别
每日练习------输出一个整数的二进制数、八进制数、十六进制数。
[GO Language Basics] 1. Why do I want to learn Golang and the popularization of GO language entry
MySQL fuzzy query performance optimization
[Image detection] Research on cumulative weighted edge detection method based on grayscale image with matlab code
MYSQL-InnoDB的线程模型
429. N 叉树的层序遍历(两种解法)
Teach you to completely uninstall MySQL
[GStreamer] The name of the plugin should match GST_PLUGIN_DEFINE
4461. 范围分区(Google Kickstart2022 Round C Problem B)
Falling ants (Peking University entrance exam questions)
G巴士计数(Google Kickstart2014 Round D Problem B)(DAY 89)