ant-design-pro: ๐ [BUG]pro create myapp fail
๐ bug ๆ่ฟฐ
/usr/local/lib/node_modules/@ant-design/pro-cli/src/create/generators/ant-design-pro/index.js:10
const sortPackage = require('sort-package-json');
^
Error [ERR_REQUIRE_ESM]: require() of ES Module /usr/local/lib/node_modules/@ant-design/pro-cli/node_modules/sort-package-json/index.js from /usr/local/lib/node_modules/@ant-design/pro-cli/src/create/generators/ant-design-pro/index.js not supported.
Instead change the require of /usr/local/lib/node_modules/@ant-design/pro-cli/node_modules/sort-package-json/index.js in /usr/local/lib/node_modules/@ant-design/pro-cli/src/create/generators/ant-design-pro/index.js to a dynamic import() which is available in all CommonJS modules.
at Object.<anonymous> (/usr/local/lib/node_modules/@ant-design/pro-cli/src/create/generators/ant-design-pro/index.js:10:21)
at /usr/local/lib/node_modules/@ant-design/pro-cli/src/create/index.js:15:23
at new Promise (<anonymous>)
at runGenerator (/usr/local/lib/node_modules/@ant-design/pro-cli/src/create/index.js:8:10)
at run (/usr/local/lib/node_modules/@ant-design/pro-cli/src/create/index.js:35:12)
at Object.<anonymous> (/usr/local/lib/node_modules/@ant-design/pro-cli/cli.js:60:34) {
code: 'ERR_REQUIRE_ESM'
}
Node.js v19.4.0
๐ท ๅค็ฐๆญฅ้ชค | Recurrence steps
pro create myapp
๐ ๆๆ็ปๆ | Expected results
ยฉ ็ๆฌไฟกๆฏ
- Ant Design Pro ็ๆฌ: latest
- umi ็ๆฌ
- ๆต่งๅจ็ฏๅข
- ๅผๅ็ฏๅข macOS
๐ ๅ ถไปไฟกๆฏ
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 32
npm i @ant-design/pro-cli -g ่ฟๅ ฅ@ant-design/pro-cli ็ฎๅฝไธญ npm i sort-package-json@1.55.0 -D ้ๆฐๅๅปบ้กน็ฎpro create my-app
Same error
Update: step1.open ant-design folder cd /usr/local/lib/node_modules/@ant-design/pro-cli step2.install sort-package-json npm i sort-package-json@1.55.0 -D Follow the step,i have solved this problem.
this fixed! THANKS!
For windows:
Open VSCODE
Hi guys, I recommend you to take a look here for the installation; https://v5-pro.ant.design/docs/getting-started/
same error