更新时间:2022-04-29 GMT+08:00
eslint: error 'CLODOP' is not defined
问题现象
执行Npm构建任务时,日志报如下异常信息:
Module Error (from ./node_modules/@vue/cli-plugin-eslint/node_modules/eslint-loader/index.js): ***//public/LodopFuncs.js 79:25 error 'getCLodop' is not defined no-undef 80:27 error Empty block statement no-empty 89:21 error 'CLODOP' is not defined no-undef
原因分析
如上异常报LodopFuncs.js文件中函数未声明is not defined,可先排查文件;文件正常则可能是不符合eslint规范导致报错。
处理方法
- 检查LodopFuncs.js文件中getCLodop函数是否已定义。
- 如果文件正常,可以在eslint检查不通过的文件头部添加如下命令行忽略eslint的检查。
/* eslint-disable */
父主题: Npm构建
Npm构建 所有常见问题
- JavaScript heap out of memory
- Unexpected end of JSON ...
- enoent ENOENT: no such file or directory
- Module not found: Error: Can't resolve ...
- NPM构建失败,但不显示错误日志
- npm cb() never called
- gyp ERR! stack Error: EACCES: permission denied
- eslint: error 'CLODOP' is not defined
- node-sass下载失败
- error: could not write config file
- npm构建耗时且安装依赖缓慢
- 找不到依赖版本
more