Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
james70s opened this issue Feb 17, 2021 · 4 comments
Closed

Comments

@james70s
Copy link

james70s commented Feb 17, 2021

第一步:
$ 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/[email protected]"]. This could result in non-deterministic behavior, skipping.
[4/5] 🔗 Linking dependencies...
warning "@ant-design/pro-descriptions > @ant-design/[email protected]" has incorrect peer dependency "react@^16.x".
warning " > @ant-design/[email protected]" has incorrect peer dependency "react@^16.x".
warning "@ant-design/pro-descriptions > @ant-design/[email protected]" has incorrect peer dependency "react@^16.x".
...

[5/5] 🔨 Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
info Direct dependencies
└─ @umijs/[email protected]
info All dependencies
└─ @umijs/[email protected]
$ 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
Copy link

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

@ttys026
Copy link
Contributor

ttys026 commented Apr 13, 2021

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

@ttys026 ttys026 closed this as completed Apr 14, 2021
@chenyangyang123
Copy link

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

@pgl-g
Copy link

pgl-g commented Apr 12, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants