Show Buttons
Share On Facebook
Share On Twitter
Share On Google Plus
Share On Linkdin
Share On Reddit
Share On Stumbleupon
Contact us
Hide Buttons

Category: Nodejs


set the default node version using nvm

If you are using nvm for man­ag­ing nodejs(which is the rec­om­mended way), you can eas­ily ensure that the same ver­sion of nodejs is avail­able in all ter­mi­nal win­dows or tabs. Below are some helpful…


exports is not defined

This is very com­mon error when your project has ES6 mod­ules as well as require.js mod­ule sys­tems. Here, I will show you few exam­ples on how to require ES6 mod­ules inside an AMD module.…


Use node in es6 syntax with babel transpiling

Install the fol­low­ing pack­ages : npm i –save babel-register npm i –save babel-preset-latest Cre­ate an entry point. For exam­ple, index.js It tran­spiles your app at run­time by hook­ing into all require calls, and lets…


nodejs: generate uuid / guid

node-uuid pro­vide a sim­pler and reli­able way to cre­ate unique id. It is rig­or­ous imple­men­ta­tion of RFC4122 (v1 and v4) UUIDs. // npm i node-uuid var uuid = require(‘node-uuid’); // Gen­er­ate a v1 (time-based) id…


Resolved — sudo npm command not found

Recently when I was try­ing to run my appli­ca­tion on an ubuntu vir­tual server, I kept get­ting the error npm com­mand not found even though I had installed nvm an node. Based on my…