这个是前端 vue 中的 Excel 文件导出时用到的

程序启动的时候出现错误,显示:not found ./cptable in node_modules/xlsx-style/dist/cpexcel.js
这个不是程序的问题,而是,在该文件目录下面,有段程序写错了,

在该js文件里,第807行,var cpt = require(’./cpt’ + ‘able’);有误,

改成 var cpt = cptable; 就可以正确启动程序了

问题所在:\node_modules\xlsx-style\dist\cpexcel.js 807行   var cpt = require('./cpt' + 'able');

解决方案1: 修改为  var cpt = cptable  修改的只是本地文件

解决方案2:webpack.base.conf.js 

module.exports = {
    externals: [ {
         './cptable': 'var cptable' 
    }]
}
 

参考链接:

not found cptable in node_modules/xlsx-style/dist/cpexcel.js

https://blog.csdn.net/qq_24044863/article/details/100011265

 

vue引用xlsx-style组件 报错:This relative module was not found: ./cptable in ./node_modules/xlsx-style

https://blog.csdn.net/jing_mama/article/details/108362669

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐