我正在 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
path: '...node_modules\\isexe\\package.json',
requestPath: 'isexe'
code: 'MODULE_NOT_FOUND'
我的
package.json
中的 main 设置为“dist/index.js”
这个错误是什么以及如何解决它?
您可以尝试清理缓存吗:
npm cache clean
如果不起作用,请尝试:
npm cache clean --force
另外,我看不到你的文件夹结构,但我认为路线是:'./dist/index.js',而不是'dist/index.js'。
仅清理缓存对我来说不起作用,但删除模块目录和锁定文件。
package-lock.json
。node_modules
目录。npm-install