ant-design / ant-design-pro

👨🏻‍💻👩🏻‍💻 Use Ant Design like a Pro!
https://pro.ant.design
MIT License
36.51k stars 8.15k forks source link

missing dependencies rc-util #8446

Closed mrs01dev closed 3 years ago

mrs01dev commented 3 years ago

please add rc-util dependency to package.json

issue From windows 10 powerShell , using pnpm: PS B:\ant-design-pro> pnpm dev

ant-design-pro@4.5.0 dev B:\ant-design-pro npm run start:dev

ant-design-pro@4.5.0 start:dev B:\ant-design-pro cross-env REACT_APP_ENV=dev MOCK=none UMI_ENV=dev umi dev

Bundle with webpack 5... Starting the development server...

× Webpack Compiled with some errors in 1.06m

ERROR Failed to compile with 1 errors 1:43:28 PM

This dependency was not found:

To install it, you can run: npm install --save rc-util/es/hooks/useMergedState

chenshuai2144 commented 3 years ago

It looks like your package installation failed. Try to delete lock and reinstall?

mrs01dev commented 3 years ago

package.json have no declaration for rc-uti. "dependencies": { "@ant-design/icons": "^4.0.0", "@ant-design/pro-descriptions": "^1.2.0", "@ant-design/pro-form": "^1.3.0", "@ant-design/pro-layout": "^6.9.0", "@ant-design/pro-table": "^2.17.0", "@umijs/route-utils": "^1.0.33", "antd": "^4.15.0", "classnames": "^2.2.6", "lodash": "^4.17.11", "moment": "^2.25.3", "omit.js": "^2.0.2", "react": "^16.14.0", "react-dev-inspector": "^1.1.1", "react-dom": "^17.0.0", "react-helmet-async": "^1.0.4", "umi": "^3.4.1", "umi-request": "^1.0.8" }, package.json should include declaration for rc-uti , as: "dependencies": { "@ant-design/icons": "^4.0.0", "@ant-design/pro-descriptions": "^1.2.0", "@ant-design/pro-form": "^1.3.0", "@ant-design/pro-layout": "^6.9.0", "@ant-design/pro-table": "^2.17.0", "@umijs/route-utils": "^1.0.33", "antd": "^4.15.0", "classnames": "^2.2.6", "lodash": "^4.17.11", "moment": "^2.25.3", "omit.js": "^2.0.2", "rc-util": "^5.12.2", "react": "^16.14.0", "react-dev-inspector": "^1.1.1", "react-dom": "^17.0.0", "react-helmet-async": "^1.0.4", "umi": "^3.4.1", "umi-request": "^1.0.8" },

xinshangshangxin commented 2 years ago

because of use pnpm the difference between npm and pnpm: 中文 / English

I run next cmd, it success

pnpm i umi-request rc-util
pnpm i -D swagger-ui-react
WLyKan commented 2 years ago

because of use pnpm the difference between npm and pnpm: 中文 / English

I run next cmd, it success

pnpm i umi-request rc-util
pnpm i -D swagger-ui-react

我也遇到这个问题了,因为硬盘空间日益减少,决定切换pnpm.

根据文档:

只有真正在依赖项中的包才能访问。 使用平铺的 node_modules 结构,所有被提升的包都可以访问。