Muhammad Usman Muhammad Usman - 11 days ago 13
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

you have to install node modules first.

cd C:\Program Files\nodejs\
npm install
node file.js