Error: ENOENT, open favicon.ico

I'm new to node and express

I created an express project example by first writing

express test1

then i did

npm install

To test the application, I do node app.js, but I get this error

Error: ENOENT, open '/ Home / test1 / node_modules / express / node_modules / connection / node_modules / static favicon /../ state / favicon.ico'

I did some search queries, and I'm not sure if this is a solution, this is a demo application from express and should work, I got tired last week and it worked.

Any ideas would be appreciated.

+4
source share
1 answer

Add this line to the initialization section of your app.js application:

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

, app.js , favicon public/favicon.ico .

+3

Source: https://habr.com/ru/post/1534959/


All Articles