My First Post      My Facebook Profile      My MeOnShow Profile      W3LC Facebook Page      Learners Consortium Group      Job Portal      Shopping @Yeyhi.com

Pages










Showing posts with label npx. Show all posts
Showing posts with label npx. Show all posts

Thursday, August 15, 2024

Some simple dev setups on Mac developer machine

 Install HomeBrew on Mac:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"


==> Next steps:

- Run these two commands in your terminal to add Homebrew to your PATH:

    (echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/mfaiz/.zprofile

    eval "$(/opt/homebrew/bin/brew shellenv)"

- Run brew help to get started

- Further documentation:


Install NodeJs:

brew install node@20



If you need to have node@20 first in your PATH, run:

  echo 'export PATH="/opt/homebrew/opt/node@20/bin:$PATH"' >> ~/.zshrc


For compilers to find node@20 you may need to set:

  export LDFLAGS="-L/opt/homebrew/opt/node@20/lib"

  export CPPFLAGS="-I/opt/homebrew/opt/node@20/include"


# verifies the right Node.js version is in the environment

node -v 

# verifies the right npm version is in the environment

npm -v 


In case node command etc not working then link it using following command:

% brew link node@20



Create React App:


npx create-react-app little-billi

cd my-app

npm start


If you've previously installed create-react-app globally via npm install -g create-react-app, we recommend you uninstall the package using npm uninstall -g create-react-app or yarn global remove create-react-app to ensure that npx always uses the latest version.



When npm starts the server, Then open http://localhost:3000/ to see your app.

When you’re ready to deploy to production, create a minified bundle with npm run build.

Meanwhile in browser you could see: