npm 包 [电子邮件受保护] 错误找不到模块 './shared/untyped.a47b2336.cjs'

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

我正在学习一个nuxt项目,它使用

[email protected]

当我完成
yarn install
时,我输入了
yarn run dev
,但我收到如下错误消息:

$ yarn run dev
yarn run v1.22.19
$ nuxt dev --open
Nuxt 3.0.0-rc.3                                                                                                                                                         2:13:18 PM

 ERROR  Cannot find module './shared/untyped.a47b2336.cjs'                                                                                                              2:13:18 PM
Require stack:
- ~/mycode/nuxt-project-clone/node_modules/untyped/dist/index.d.cts

我检查了依赖关系:

$ npm ls untyped
~/mycode/nuxt-project-clone
├─┬ @nuxtjs/[email protected]
│ └─┬ @nuxt/[email protected]
│   └── [email protected]
└─┬ [email protected]
  ├─┬ @nuxt/[email protected]
  │ └── [email protected] deduped
  └── [email protected]

然后探索了

untyped
包:

$ cat node_modules/untyped/dist/index.d.cts
import { I as InputObject, S as Schema, a as SchemaDefinition } from './shared/untyped.a47b2336.cjs';
export { F as FunctionArg, c as InputValue, b as JSType, J as JSValue, R as ResolveFn, T as TypeDescriptor } from './shared/untyped.a47b2336.cjs';
....

并且包装上没有

./shared/untyped.a47b2336.cjs

$ ls node_modules/untyped/dist/shared/
untyped.84362cee.cjs
untyped.a47b2336.d.cts
untyped.a47b2336.d.mts
untyped.a47b2336.d.ts
untyped.b44a3145.cjs
untyped.bd7ca8a5.mjs

但是我昨天确实成功运行了该项目。我刚刚删除了node_modules并重新安装了软件包,结果出现了这个错误。

[电子邮件受保护]”包裹是否在一夜之间发生变化?

npm nuxt.js
1个回答
0
投票

untyped: 1.4.1
造成了这个,

解决方案1:
将以下行添加到您的 package.json 中:

  "resolutions": { "untyped": "=1.4.0" },

解决方案2:

"overrides": {
  "untyped": "1.4.0"
},
© www.soinside.com 2019 - 2024. All rights reserved.