new commands are installed but they still don't work

129 Views Asked by At

Friends-MacBook-Pro:~ friend$ npm install -g live-server

/Users/friend/.npm-global/bin/live-server -> /Users/friend/.npm-global/lib/node_modules/live-server/live-server.js

  • [email protected] updated 1 package in 15.078s Friends-MacBook-Pro:~ friend$ live-server -v

-bash: live-server: command not found

Friends-MacBook-Pro:~ friend$ 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 + [email protected] added 106 packages in 13.884s

╭─────────────────────────────────────╮ │ │ │ Update available 5.5.1 → 5.6.0 │ │ Run npm i -g npm to update │ │ │ ╰─────────────────────────────────────╯

Friends-MacBook-Pro:~ friend$ npm i -g npm + [email protected]

added 1 package in 1.566s

Friends-MacBook-Pro:~ friend$ create-react-app newtypelabs.io

-bash: create-react-app: command not found

1

There are 1 best solutions below

0
Ben On

You should add the bin path to your user environment.

echo 'export PATH="/Users/friend/.npm-global/bin:$PATH"' >> ~/.bash_profile