Package manager:

Manage node version using n

npm install -g n # setup

n 0.10.33  # install/use v0.10.33
n latest # install/use the latest version
n stable # install/use the latest stable version

Downgrade the npm (make sure your node is compatable with npm)

npm install -g npm@3.10.10

Update the npm

npm install npm@latest -g

Another alternative is using NVM –> never tried

setting up a minimal node with webpack and babel

Where does npm install package?


npm list -g # global library
npm list # local library

npm root -g
npm rooot

# global library possiblity
cd /usr/local/lib/node
cd /usr/local/lib/node_modules
cd %USERPROFILE%\AppData\npm\node_modules # windows XP
cd %USERPROFILE%\AppData\Roaming\npm\node_modules # windows 7/8/10

# local library
cd node_modules

Production Process Manager

Error: Maximum call stack size exceeded

Try one of below:

  1. Remove package-lock.json
  2. Clear cache npm cache clean --force
  3. NPM Rebuild npm rebuild

Code snippet

Read file line by line

var lineReader = require('readline').createInterface({
  input: require('fs').createReadStream('')

lineReader.on('line', function (line) {
  console.log('Line from file:', line);