找不到RequestPath模块isexe

问题描述 投票:0回答:2

我正在 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”

这个错误是什么以及如何解决它?

reactjs npm bamboo
2个回答
4
投票

您可以尝试清理缓存吗:

npm cache clean

如果不起作用,请尝试:

npm cache clean --force

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


0
投票

仅清理缓存对我来说不起作用,但删除模块目录和锁定文件。

步骤

  1. 删除
    package-lock.json
  2. 删除
    node_modules
    目录。
  3. 奔跑
    npm-install
© www.soinside.com 2019 - 2024. All rights reserved.