Error: Cannot find module 'C:\...\node_modules\isexe\index.js'. Please verify that the package.json has a valid "main" entry

Error: Cannot find module 'C:\...\node_modules\isexe\index.js'. Please verify that the package.json has a valid "main" entry

我是 Bamboo 运行 npm run test:CI(开玩笑-html-记者)CI 但是出现了这个错误:

node:internal/modules/cjs/loader:361
throw err;
^
Error: Cannot find module 'C:\...\node_modules\isexe\index.js'. Please verify that the package.json has a valid "main" entry

我的package.json中的main设置为'dist/index.js'

这是什么错误,我该如何解决?

你能试试清理缓存吗:

npm cache clean

如果不行试试:

npm cache clean --force

此外,我看不到你的文件夹结构,但我认为路径是:'./dist/index.js',而不是 'dist/index.js'.