使用yarn create umi安装Ant Design Pro时报错TypeError: self.env.emit is not a function

Adeline ·
更新时间:2024-11-10
· 680 次阅读

解决self.env.emit is not a function报错 报错内容 TypeError: self.env.emit is not a function at /usr/local/share/.config/yarn/global/node_modules/yeoman-generator/lib/index.js:653:22 at processTicksAndRejections (internal/process/task_queues.js:97:5) Emitted 'error' event on Generator instance at: at Immediate. (/usr/local/share/.config/yarn/global/node_modules/yeoman-generator/lib/index.js:668:20) at processImmediate (internal/timers.js:456:21) error Command failed. Exit code: 1 Command: /usr/local/bin/create-umi Arguments: Directory: /data/projects/umi1 Output: info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command. yarn global dir找到yarn的全局包的package.json 比如我的是 C:\Users\**\AppData\Local\Yarn\Data\global 打开该文件夹下的package.json,添加 { "dependencies": { "create-umi": "^0.20.1" }, "resolutions": { "create-umi/yeoman-generator": "4.5.0" } } 重新yarn create umi

在这里插入图片描述


作者:Hi~Antonio



self emit pro env NOT IS create ant yarn

需要 登录 后方可回复, 如果你还没有账号请 注册新账号
相关文章
Alysa 2020-05-09
796