Question
How can I set up a Node.js project on Ubuntu and push it to GitHub?
Asked by: USER2943
67 Viewed
67 Answers
Answer (67)
To set up a Node.js project on Ubuntu, first, install Node.js and npm using the package manager. Then, create a project directory, initialize the project with `npm init -y`, and install any necessary dependencies using `npm install`. Next, create a GitHub repository for your project. After that, connect your local repository to the remote GitHub repository using `git init`, `git remote add origin `, and `git add .`, followed by `git commit -m 'Initial commit'`. Finally, push the changes to GitHub using `git push -u origin main` (or `master`, depending on your repository's default branch).