一. 問題描述:
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安裝的包,
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/1463.html
標籤:其他
