Passport: TypeError: Cannot set property ‘user’ of undefined [closed]

When logged in it returns this error:

[SERVER] TypeError: Unable to set the 'user' property of undefined
[SERVER] a node_modulespassport-remember-menode_modulespassportlibpassporthttprequest.js:45:35
[SERVER] a node_modulespassportlibauthenticator.js:292:43)
[SERVER] a node_modulespassportlibauthenticator.js:301:7)
[SERVER] a configurepassport.js:55:5
[SERVER] a pass node_modulespassportlibauthenticator.js:309:9)
[SERVER] a Authenticator.serializeUser (node_modulespassportlibauthenticator.js:314:5)
[SERVER] a IncomingMessage.req.login.req.logIn (node_modulespassport-remember-menode_modulespassportlibpassporthttprequest.js:43:29)
[SERVER] a app.js:477:13.
[SERVER] a Strategy.strategy.success (node_modulespassportlibmiddlewareauthenticate.js:222:18)
[SERVER] a verified (node_modulespassport-locallibstrategy.js:83:10)
[SERVER] a callback (node_modules_passport-localstrategy.js:83:10)
[SERVER] a Child.<anonymous> (routescommonpermissions.js:594:7)
[SERVER] a Child.tryCatcher (node_modulesbluebirdjsreleaseutil.js:16:23)
[SERVER] a Promise._settlePromiseFromHandler (node_modulesbluebirdjsreleasepromise.js:547:31)
[SERVER] to Promise._settlePromise (node_modulesbluebirdjsreleasepromise.js:604:18)
[SERVER] to Promise._settlePromise0 (node_modulesbluebirdjsreleasepromise.js:649:10)

These are the versions of libraries:

“passport“:”^0.7.0”,
    “passport-local“:”^1.0.0”,
    “passport-remember-me": ‘0.0.1’,

the strange thing is that I have this problem after I made the project from scratch with git clone.
The project to my colleague works correctly, it only creates this problem when you create it clean and install the libraries from scratch.