Friends-MacBook-Pro:〜朋友$ npm install -g live-server
/Users/friend/.npm-global/bin/live-server - > /Users/friend/.npm-global/lib/node_modules/live-server/live-server.js
-bash:live-server:command not found
Friends-MacBook-Pro:〜朋友$ npm install -g create-react-app /Users/friend/.npm-global/bin/create-react-app - > /Users/friend/.npm-global/lib/node_modules/create-react-app/index.js + create-react-app@1.4.3 在13.884s中添加了106个包
╭─────────────────────────────────────╮ ││ │更新可用5.5.1→5.6.0│ │运行npm i -g npm更新│ ││ ╰─────────────────────────────────────╯
朋友 - MacBook-Pro:〜朋友$ npm i -g npm + npm@1.0.0
在1.566s中添加了1个包
Friends-MacBook-Pro:〜朋友$ create-react-app newtypelabs.io
-bash:create-react-app:command not found
答案 0 :(得分:0)
您应该将bin路径添加到用户环境中。
echo 'export PATH="/Users/friend/.npm-global/bin:$PATH"' >> ~/.bash_profile