NODEJS “CORS Errors”

NodeJS can be configured to use CORS as means of communicating from the front-end. This can be configured in your app.js as middleware for the popular Express package. CORS errors look something like this: Both servers are running on different ports. Remember that different port consists as a cross domain request. localhost:8080 is a different …

Setting NODE_PATH on Windows

If your getting errors like ‘cannot find module x’ when trying to start a nodejs server on windows then you probably have some code which is looking for node modules but they are not being found. This could be a number of reasons but node will look in the default folders for the module and …

npm install error

I have no idea why the install of npm is failing. There is nothing online about this error so here it is. “AgentSSL.prototype.addRequest” -> “TypeError: Cannot read property ‘prototype’ of undefined”. I’ve tried to install npm using the following with no luck (as suggested). curl https://npmjs.org/install.sh | sh curl https://npmjs.org/install.sh | sudo sh git clone …

cannot find module ‘jsdom’

An error I came across when trying to install jsdom npm package on my windows machine. “cannot find module ‘jsdom’. Solutions: 1. Follow instructions on this blog post to get jsdom working on windows. http://www.steveworkman.com/node-js/2012/installing-jsdom-on-windows/ 2. Use an alternative (lighter) package called Cheerio. Notes: Something I ran into was this error when using cheerio. “cheerio …

101 Troubleshooting Yeoman Installs

So your trying to use Yeoman with Node.js and running into problems and errors? Maybe this post can help you. “Easy with the “sudo”; Yeoman is the master around here.” Ok so you’ve seen this error when trying to use Yeoman. “Easy with the “sudo”; Yeoman is the master around here.” Now what? “Since yo …

warn – error raised: Error: listen EADDRINUSE

Seeing this error “warn – error raised: Error: listen EADDRINUSE”? Well let’s see how we can solve it. About the error This error is caused by the port number already being used by another process. So we need to find that process and kill it. The Best Solution linux find all active processes netstat -tulpn …

Node.js cannot find module x

Here is some diagnostic checks you can try if your using Node.js and it reports that it “cannot find module x”. These commands are obviously relative to what packages your using. Possible causes & solutions Not installing node packages globally, use the -g flag in the following command. npm install grunt -g NODE_PATH is not …