Skip to content

Instantly share code, notes, and snippets.

View ChanManChan's full-sized avatar
🎯
Focusing

Nanda Gopal ChanManChan

🎯
Focusing
View GitHub Profile

I think the best way to manage node.js is to use NVM. NVM stands for Node Version Manager.

It's a must-have tool for node.js developers!

You can install NVM using the following command, open terminal and run any one of the following:-

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
var x=12345652457.557;
  x=x.toString();
  var afterPoint = '';
  if(x.indexOf('.') > 0)
     afterPoint = x.substring(x.indexOf('.'),x.length);
  x = Math.floor(x);
  x=x.toString();
  var lastThree = x.substring(x.length-3);
var otherNumbers = x.substring(0,x.length-3);
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth() + 1; //January is 0!

var yyyy = today.getFullYear();
if (dd < 10) {
  dd = '0' + dd;
} 
if (mm &lt; 10) {

Uninstall Node.js and npm

Uninstall node.js and npm installed using Windows Installer (msi) To uninstall node.js and npm, Open Windows "Control Panel" -> "Uninstall a program", select Node.js and click on uninstall to uninstaill both node.js and npm Uninstall node.js and npm installed using Windows Binary (zip) Delete the extracted directory

Cleanup directories After the uninstall, look for the following folders and delete them if exists

  • Nodejs installed directory
  • npm and npm-cache directories from %appdata% directory

To remove node and npm

sudo apt-get purge --auto-remove nodejs

Install nvm, node.js, and npm

1.Install cURL (a tool used for downloading content from the internet in the command-line) with: sudo apt-get install curl

i'm on ubuntu for windows 10 (on a windows VM--i don't think the VM part matters though). i was getting the same errors as @RichiCoder1

: not foundram Files/nodejs/npm: 3: /mnt/c/Program Files/nodejs/npm:
: not foundram Files/nodejs/npm: 5: /mnt/c/Program Files/nodejs/npm:
/mnt/c/Program Files/nodejs/npm: 6: /mnt/c/Program Files/nodejs/npm: Syntax error: word unexpected (expecting "in")
i have node installed for windows (off the nodejs site). i kept it around, and in addition i followed @mrtopf's install instructions
$ curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
# Links & Documentation
- Final Repo - https://github.com/bradtraversy/devcamper-api
- Final Deployed Project - https://devcamper.io
- Specs Sheet - https://gist.github.com/bradtraversy/01adb248df70fb29e98c30cf659042cf
## Tools
- Node.js - https://nodejs.org/en/
- VSCode - https://code.visualstudio.com/
@ChanManChan
ChanManChan / profiles.json
Created February 2, 2020 13:54 — forked from mehulmpt/profiles.json
Sample profiles.json for new Windows Terminal
{
"defaultProfile": "{09dc5eef-6840-4050-ae69-21e55e6a2e62}",
"initialRows": 30,
"initialCols": 120,
"alwaysShowTabs": true,
"showTerminalTitleInTitlebar": true,
"experimental_showTabsInTitlebar": true,
"profiles": [
{
"guid": "{09dc5eef-6840-4050-ae69-21e55e6a2e62}",
@ChanManChan
ChanManChan / node_nginx_ssl.md
Created February 2, 2020 04:34 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@ChanManChan
ChanManChan / docker-help.md
Created January 25, 2020 11:07 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info