Prash's Blog

Node.js error Error: Cannot find module XYZ April 24, 2012

Filed under: Nodejs — prazjain @ 9:45 am
Tags: ,

Generally you will see an error like this when a npm node package is not installed properly or not installed in proper location.
Error :

node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module 'XYZ'
at Function._resolveFilename (module.js:334:11)
at Function._load (module.js:279:25)
at Module.require (module.js:357:17)
at require (module.js:368:17)

In my case i have seen this happening when I have installed a node module using -g switch, so to fix this I would uninstall the module again and install it without -g switch as shown below :


npm install XYZ

Advertisements
 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s