我正在使用Yarn v0.16.1。如果我理解正确(根据文档),yarn global add <package>
应等同于npm install -g <package>
。但是,当我在docs(带有create-react-app
)中运行示例时,该命令成功运行,但是create-react-app
在命令行中不可用。这是输出:
$ yarn global add create-react-app
$ yarn global v0.16.1
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
[4/4] 📃 Building fresh packages...
success Installed create-react-app@0.6.0 with binaries:
- create-react-app
✨ Done in 3.22s.
$ create-react-app --help
-bash: create-react-app: command not found
使用npm进行全局安装具有预期结果,并且一切正常。纱我想念什么?
source ~/.bash_profile
。