How to update node to a given version

Scenario:- Update node to the given version ?

Solution:- 

Using nvm:-Node Version Manager

Install nvm 

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
  1. Reopen the terminal
  2. Check nvm is installed by typing nvm > enter > it will show nvm commands
  3. nvm install Node_Version_i_Want
$ nvm install 8.9.4

Note:- After installing the latest node incase your build fails with error like

Node Sass could not find a binding for your current environment: OS X 64-bit with Node.js 8.x

Solution is simply run the sass build npm rebuild node-sass

Working with prettier in Visual studio code

“Whenever you are confronted with an opponent, conquer them with love.”

What is prettier ?

In layman terms its an handy tool that will format our code against some set standards, default formatting rules to achieve consistent code style.

How to install prettier  in VS Code?

Search > Prettier – Code formatter

Prettier - Code formatter

Note:- Incase you have different IDE try installing prettier.

How to do perform user specific settings for prettier?

VS Code > File > Preferences > Settings > Under ‘user setttings’

vscode with prettier

 

 

 

 

 

    // Set the default prettier settings
    "editor.formatOnSave": false,
    "prettier.singleQuote": true,
    "prettier.trailingComma": "all",
    // Enable per-language
    "[javascript]": {
        "editor.formatOnSave": true
    }