因项目需求引入了第三方组件live-cat,然后node-modules报错(实际上是找到了的,不知为啥报错)
为解决此问题,我尝试了很多方法
1.tsconfig.json文件中,添加type,还有exclude,未生效
"types": [
"node",
]
2.在.eslintignore中加入对应文件,未生效
3.引入patch-package,此方法本地install确实生效,但jenkins上线时,依旧报错;
4.升级typescript,依旧报错
最后,尝试了require,解决了
// import {Launcher} from "live-cat";
const {Launcher} =require("live-cat")