umijs / plugins

🍣 The one-stop shop for official Umi plugins and presets.
349 stars 238 forks source link

安装@umijs/plugin-model 插件后出现is already registered 错误 #538

Closed james70s closed 3 years ago

james70s commented 3 years ago

第一步: $ yarn create umi myapp 选择 ❯ ant-design-pro ❯ Pro V5

第二步:add plugin-model $ yarn add @umijs/plugin-model --dev

出错: warning Pattern ["@umijs/plugin-model@^2.5.6"] is trying to unpack in the same destination "/Users/Admin/Library/Caches/Yarn/v6/npm-@umijs-plugin-model-2.5.6-1eec24000d608375d0790fb6713a50d7ee7b5153-integrity/node_modules/@umijs/plugin-model" as pattern ["@umijs/plugin-model@2.5.6"]. This could result in non-deterministic behavior, skipping. [4/5] 🔗 Linking dependencies... warning "@ant-design/pro-descriptions > @ant-design/pro-field@1.9.4" has incorrect peer dependency "react@^16.x". warning " > @ant-design/pro-form@1.15.4" has incorrect peer dependency "react@^16.x". warning "@ant-design/pro-descriptions > @ant-design/pro-skeleton@1.0.0-beta.12" has incorrect peer dependency "react@^16.x". ...

[5/5] 🔨 Building fresh packages... success Saved lockfile. success Saved 1 new dependency. info Direct dependencies └─ @umijs/plugin-model@2.5.6 info All dependencies └─ @umijs/plugin-model@2.5.6 $ umi g tmp plugin @umijs/plugin-model is already registered by /Users/Admin/antd5/node_modules/@umijs/plugin-model/lib/index.js, plugin from /Users/Admin/antd5/node_modules/@umijs/plugin-model/lib/index.js register failed. Error: plugin @umijs/plugin-model is already registered by /Users/Admin/antd5/node_modules/@umijs/plugin-model/lib/index.js, plugin from /Users/Admin/antd5/node_modules/@umijs/plugin-model/lib/index.js register failed. at Service.registerPlugin (/Users/Admin/antd5/node_modules/@umijs/core/lib/Service/Service.js:457:13) at /Users/Admin/antd5/node_modules/@umijs/core/lib/Service/Service.js:436:14 at Generator.next () at asyncGeneratorStep (/Users/Admin/antd5/node_modules/@umijs/core/lib/Service/Service.js:108:103) at _next (/Users/Admin/antd5/node_modules/@umijs/core/lib/Service/Service.js:110:194) at /Users/Admin/antd5/node_modules/@umijs/core/lib/Service/Service.js:110:364 at new Promise () at /Users/Admin/antd5/node_modules/@umijs/core/lib/Service/Service.js:110:97 at Service.initPlugin (/Users/Admin/antd5/node_modules/@umijs/core/lib/Service/Service.js:442:7) at /Users/Admin/antd5/node_modules/@umijs/core/lib/Service/Service.js:317:22 error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

清掉项目中的node_modules,和/Users/Admin/Library/Caches/Yarn/v6的缓冲再试还是一样。 不知什么原因?

Chinalink commented 3 years ago

同样的问题,删掉package.json 里新加的@umijs/plugin-model。 正常启动应用即可

ttys026 commented 3 years ago

preset-react 中默认包含这个插件,不需要装到依赖中

chenyangyang123 commented 2 years ago

preset-react 中的插件版本比较旧, 怎么更新呢

pgl-g commented 7 months ago

有没有其他解决方案大佬们