ExpressJS – throw er Unhandled error event

I created expressjs application using the following commands: express -e folderName npm install ejs –save npm install When I run the application with: node app.js, I have the following errors: events.js:72 throw er; // Unhandled ‘error’ event ^ Error: listen EADDRINUSE at errnoException (net.js:884:11) at Server._listen2 (net.js:1022:14) at listen (net.js:1044:10) at Server.listen (net.js:1110:5) at Object.<anonymous> … Read more

NPM cannot install dependencies – Attempt to unlock something which hasn’t been locked

I’ve been trying to run an npm install on my package.json file, but I’m having a lot of trouble. It keeps saying “Error: Attempt to unlock XXX, which hasn’t been locked” on all my dependences. Here’s one of them: Error: Attempt to unlock tbd@~0.6.4, which hasn’t been locked at unlock (/usr/local/lib/node_modules/npm/lib/cache.js:1304:11) at cb (/usr/local/lib/node_modules/npm/lib/cache.js:646:5) at … Read more

Install dependencies globally and locally using package.json

Using npm we can install the modules globally using -g option. How can we do this in the package.json file? Suppose, these are my dependencies in package.json file “dependencies”: { “mongoose”: “1.4.0”, “node.io” : “0.3.3”, “jquery” : “1.5.1”, “jsdom” : “0.2.0”, “cron” : “0.1.2” } When i run npm install, I want only node.io to … Read more