NodeJS
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
https://github.com/facebook/create-react-app
Where does npm install package?
og: https://stackoverflow.com/questions/5926672/where-does-npm-install-packages/5926706#5926706
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 $NODE_PATH
cd %USERPROFILE%\AppData\npm\node_modules # windows XP
cd %USERPROFILE%\AppData\Roaming\npm\node_modules # windows 7/8/10
# local library
cd node_modules
Error: Maximum call stack size exceeded
Try one of below:
- Remove
package-lock.json
- Clear cache
npm cache clean --force
- NPM Rebuild
npm rebuild
Code snippet
var lineReader = require('readline').createInterface({
input: require('fs').createReadStream('file.in')
});
lineReader.on('line', function (line) {
console.log('Line from file:', line);
});