i want to add a express hadllebars in m ypackage json file in my first verson ,i run it correctly ,have no any problem with my code . { "name": "LiveEmbellishedAnimatronics", "version": "1.0.0", "description": "", "main": "app.js", "dependencies": { "body-parser": "^1.19.0", "cookie-parser": "^1.4.5", "express-session": "^1.17.2", "http-errors": "^1.8.0", "morgan": "^1.10.0", "passport": "^0.5.0" }, "devDependencies": { "express": "^4.17.1" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start": "webpack-dev-server --hot" }, "keywords": [], "author": "", "license": "ISC" } this one ,works well on my pc. but my teacher said i need to add express- handlebars to my package.json file to make npm install it . and i use npm init to change my package json like this . like this "name": "LiveEmbellishedAnimatronics", "version": "1.0.0", "description": "", "main": "app.js", "dependencies": { "body-parser": "^1.19.0", "cookie-parser": "^1.4.5", "express-session": "^1.17.2", "http-errors": "^1.8.0", "morgan": "^1.10.0", "passport": "^0.5.0" "client-sessions": "^0.8.0", "express": "^4.17.1", "express-handlebars": "^4.0.4", "express-validator": "^5.3.0", "handlebars": "^4.7.7", }, "devDependencies": { "express": "^4.17.1" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start": "webpack-dev-server --hot" }, "keywords": [], "author": "", "license": "ISC" } ---------------------- now its never working . like this events.js:352 throw er; // Unhandled 'error' event ^ Error: listen EADDRINUSE: address already in use :::3000 at Server.setupListenHandle [as _listen2] (net.js:1320:16) at listenInCluster (net.js:1368:12) at Server.listen (net.js:1454:7) at Function.listen (V:\ga2\moban4943\k1\LiveEmbellishedAnimatronics (1)\wll\ node_modules\express\lib\application.js:618:24) at Object. (V:\ga2\moban4943\k1\LiveEmbellishedAnimatronics (1)\w ll\app.js:85:5) at Module._compile (internal/modules/cjs/loader.js:1085:14) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10) at Module.load (internal/modules/cjs/loader.js:950:32) at Function.Module._load (internal/modules/cjs/loader.js:790:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js :76:12) Emitted 'error' event on Server instance at: at emitErrorNT (net.js:1347:8) at processTicksAndRejections (internal/process/task_queues.js:82:21) { code: 'EADDRINUSE', errno: -4091, syscall: 'listen', address: '::', port: 3000 } whats this point ?what could i do to fix this ?
i want to add a express hadllebars in m ypackage json file
in my first verson ,i run it correctly ,have no any problem with my code .
{
"name": "LiveEmbellishedAnimatronics",
"version": "1.0.0",
"description": "",
"main": "app.js",
"dependencies": {
"body-parser": "^1.19.0",
"cookie-parser": "^1.4.5",
"express-session": "^1.17.2",
"http-errors": "^1.8.0",
"morgan": "^1.10.0",
"passport": "^0.5.0"
},
"devDependencies": {
"express": "^4.17.1"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "webpack-dev-server --hot"
},
"keywords": [],
"author": "",
"license": "ISC"
}
this one ,works well on my pc.
but my teacher said i need to add express- handlebars to my package.json file to make npm install it .
and i use npm init to change my package json like this .
like this
events.js:352
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE: address already in use :::3000
at Server.setupListenHandle [as _listen2] (net.js:1320:16)
at listenInCluster (net.js:1368:12)
at Server.listen (net.js:1454:7)
at Function.listen (V:\ga2\moban4943\k1\LiveEmbellishedAnimatronics (1)\wll\
node_modules\express\lib\application.js:618:24)
at Object.<anonymous> (V:\ga2\moban4943\k1\LiveEmbellishedAnimatronics (1)\w
ll\app.js:85:5)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js
:76:12)
Emitted 'error' event on Server instance at:
at emitErrorNT (net.js:1347:8)
at processTicksAndRejections (internal/process/task_queues.js:82:21) {
code: 'EADDRINUSE',
errno: -4091,
syscall: 'listen',
address: '::',
port: 3000
}
Trending now
This is a popular solution!
Step by step
Solved in 3 steps