我在 Bamboo CI 中运行 npm run test:CI
(jest-html-reporter) 但发生了这个错误:
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”。
关于reactjs - 错误 : Cannot find module 'C:\...\node_modules\isexe\index.js' . 请验证 package.json 是否具有有效的 "main"条目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71965953/