Installing Node.js on Linux from Binaries

  1. Download Node.js binaries

    Node.js binaries are available at nodejs.org. You can download the more stable LTS version or Current version with the latest features.

  2. Extract the download binary files

    You can either first extract the binary files to a temporary directory, then copy them to the /usr/local directory; or extract the files right into the /usr/local directory.

    1. Extract to temporary folder, and then copy the files to /usr/local folder.

      # cd temp
      # tar -xvJf ~/downloads/node-v7.2.0-linux-x64.tar.xz
      # cd node-v7.2.0-linux-x64
      # sudo cp -R . /usr/local
      
    2. Extract directly into the /usr/local folder. First change directory to /usr/local, and then issue the tar command.

      # sudo tar --strip-components=1 -xvJf ~/downloads/node-v7.2.0-linux-x64.tar.xz
      
  3. Check Node.js installation
    # node -v
    v7.2.0
    
  4. Check npm installation
    # npm version
    { npm: '3.10.9',
      ares: '1.10.1-DEV',
      cldr: '30.0.2',
      http_parser: '2.7.0',
      icu: '58.1',
      modules: '51',
      node: '7.2.0',
      openssl: '1.0.2j',
      tz: '2016g',
      unicode: '9.0',
      uv: '1.10.1',
      v8: '5.4.500.43'
      zlib: '1.2.8' }
    

CSS: Fill browser screen with Linear-gradient

Condition: When setting the background property of the <body> tag to a linear-gradient, if your page content is shorter than the full length of the browser screen, the gradient won’t fill the browser screen, but rather repeated at the end of the page content.

CSS code:

body { background: linear-gradient(#CFC, #FFF); }

Solution: set the min-height property of the document root <html> tag to 100%.

html { min-height: 100%; }