Muhammad Usman Muhammad Usman - 1 year ago 282
Javascript Question

module.js 474 throw err

I just installed the nodejs in my laptop and Im not sure how to run a js file in the node. I tried the following command,

node C:\Program Files\nodejs\file.js
but it shows this error

module.js:474 throw err

Anyone has any idea? Im totally a newbie.

Answer Source

you have to install node modules first.

cd C:\Program Files\nodejs\
npm install
node file.js
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download