一. 问题描述:
visual studio code 开发软件下,由于terminal终端默认选了powershell,所以安装了yarn,出现了不识别yarn命令的现象。yarn : The term 'yarn' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again
二. 解决
在windows系统,系统键+R,打开cmd命令窗口,则可以识别yarn命令。所以需要修改visual studio code软件中的setting对于terminal的配置。
还有一个选择,用npm install -g yarn命令安装完 yarn,接着用 npx yarn start 启动项目,而不是用npm yarn start,npx比npm的好处就是它能识别 global安装的或者非global安装的包。