I am new to working with nodejs and I'm just trying to start a server that is already working with my teammates. I am on mac and have already installed all the necessary modules with "npm install". Now, it seems the problem is with the cookie-signature module, which is already included in the express module. I try to run the program and I do not get an error, but when I try to open a page on localhost: 3000, I get the following error:
/Users/kevinglaap/Sites/Uni/git/node_server/node_modules/express/node_modules/cookie-signature/index.js:19 if ('string' != typeof secret) throw new TypeError('secret required'); ^ TypeError: secret required at Object.exports.sign (/Users/kevinglaap/Sites/Uni/git/node_server/node_modules/express/node_modules/cookie-signature/index.js:19:40) at ServerResponse.end (/Users/kevinglaap/Sites/Uni/git/node_server/node_modules/express/node_modules/connect/lib/middleware/session.js:267:34) at ServerResponse.EventEmitter.emit (events.js:93:17) at ServerResponse.res.writeHead (/Users/kevinglaap/Sites/Uni/git/node_server/node_modules/express/node_modules/connect/lib/patch.js:73:36) at ServerResponse._implicitHeader (http.js:932:8) at ServerResponse.OutgoingMessage.end (http.js:767:10) at res.end (/Users/kevinglaap/Sites/Uni/git/node_server/node_modules/express/node_modules/connect/lib/middleware/session.js:282:13) at /Users/kevinglaap/Sites/Uni/git/node_server/node_modules/express/node_modules/connect/lib/middleware/session/memory.js:73:11 at process.startup.processNextTick.process._tickCallback (node.js:244:9)
The module is never used in server resources. I already tested the use of the "sign" function, because an error is a fixed error that signals that resources may be doing something wrong, but it is only used by express or other modules inside express. Iโve searched the Internet for several days and havenโt yet found a solution. What am I missing? Thanks in advance for your help.
source share