Visit the official Node.js website at https://nodejs.org/ and download the latest LTS version (which should be 18 or higher).
Run the installer you downloaded and follow the on-screen instructions.
Use Homebrew to install Node.js:
brew install node
For Linux: Use your package manager to install Node.js. For example, on Ubuntu:
sudo apt update
sudo apt install nodejs
Open a terminal and install pnpm globally:
For Windows, macOS, and Linux:
npm install -g pnpm
Check if Node.js, npm, and pnpm are installed:
node -v
npm -v
pnpm -v
Duplicate the .env.example
file to create a new .env
file. You can do this by running the following command:
cp .env.example .env
-
Open the newly created
.env
file in a text editor of your choice. -
Set the necessary configuration variables. Some variables may already have default values in the
.env.example
file. Review and modify the values as needed.# .env NODE_ENV="development" DB_CONNECTION="mongodb://root:example@localhost:27017/" UPLOADTHING_APP_ID="" UPLOADTHING_SECRET="" ....
[!NOTE] Please ensure to obtain the missing Uploadthing environment variables from the developer.
Run the following command to install project dependencies using pnpm:
pnpm install
This command reads the dependencies from the package.json file and installs them locally.
To run your application in development mode, use the following command:
pnpm dev
This command, assuming your project is configured for it, will start the development server, allowing you to access your application locally.
Once the development server is running, open your web browser and navigate to the appropriate URL (http://localhost:5173 or as specified by your project).