今天根据一个文档生成一个项目框架的时候,报了几个错,百度上没有能解决,自己想办法解决了,记录一下。
原始命令是:yarn create vite@latest xxx --template vanilla-ts
1:首先create vite@latest这里按文档上说的是默认安装最新的版本,但我的安装过程中提示我要选一个版本,没话说,选最新的就好;
2:安装后报错:create-vite@latest is not recognized as an internal or external command
按百度上大神的说法,删了一些文件,并没有什么用,看了一下yarn的安装目录,突发奇想,把@latest给删了,再次运行,成功。至于为啥,不知道😂