问题一 umi dev 运行时报错 Path must be a string.
umi dev 运行时报错
Path must be a string.
TypeError: Path must be a string.
解决
官网方案 https://umijs.org/docs/upgrade-to-umi-3#%E5%8D%87%E7%BA%A7-umi-plugin-react-%E4%B8%BA-umijspreset-react
卸载 umi-plugin-react,安装 @umijs/preset-react
//卸载 umi-plugin-react
tyarn remove umi-plugin-react --dev
//安装 umi-plugin-react
tyarn add @umijs/preset-react --dev
问题二 安装@umijs/preset-react 再次启动 umi dev 运行时报错 @umijs\preset-react\lib\react.js failed, since Cannot find module 'umi'
umi dev 运行时报错
@umijs\preset-react\lib\react.js failed, since Cannot find module 'umi'
解决
yarn add @umijs/preset-react -D
yarn add umi
npm install
问题三 npm install 安装时报错 npm ERR! cb() never called!
npm install
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! <https://npm.community>
npm ERR! A complete log of this run can be found in:
解决 https://www.cnblogs.com/webdragon/p/9700879.html
首先要以管理员模式打开cmd清除你的npm缓存 : npm cache clean -f
npm cache clean -f
npm install -g n --force
npm install