Ray Ray - 4 years ago 218
Node.js Question

Error: ENOENT, open favicon.ico

I am newbie with node and express

I created a express sample project by first writing

express test1


then i did

npm install


For testing the application i am doing node app.js, but i am getting this error


Error: ENOENT, open
'/home/test1/node_modules/express/node_modules/connect/node_modules/static-favicon/../public/favicon.ico'


I did some googling and i am not sure the solution, this is the demo app from express and should work, i have tired this last week and it was working.

Any insights would be appreciated

Answer Source

Append this line into the initialization section of your app.js:

app.use(favicon(__dirname + '/public/favicon.ico'));

I assume that app.js is in the project directory and favicon file is at public/favicon.ico also relative to the project folder.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download