npm start does not start the server
Closed this issue · 3 comments
Below is the error message that I got when I tried to do 'npm start' the server in EC2.
pizza-luvrs@1.0.0 start /home/ec2-user/pizza-luvrs
node index.js
Error: Cannot set uncompiled validation rules without configuring a validator
at new module.exports (/home/ec2-user/pizza-luvrs/node_modules/@hapi/hapi/node_modules/@hapi/hoek/lib/error.js:23:19)
at Object.module.exports [as assert] (/home/ec2-user/pizza-luvrs/node_modules/@hapi/hapi/node_modules/@hapi/hoek/lib/assert.js:20:11)
at Object.exports.compile (/home/ec2-user/pizza-luvrs/node_modules/@hapi/hapi/lib/validation.js:48:10)
at module.exports.internals.Route._setupValidation (/home/ec2-user/pizza-luvrs/node_modules/@hapi/hapi/lib/route.js:197:43)
at new module.exports.internals.Route (/home/ec2-user/pizza-luvrs/node_modules/@hapi/hapi/lib/route.js:122:14)
at internals.Server._addRoute (/home/ec2-user/pizza-luvrs/node_modules/@hapi/hapi/lib/server.js:498:23)
at internals.Server.route (/home/ec2-user/pizza-luvrs/node_modules/@hapi/hapi/lib/server.js:491:22)
at Object.module.exports.register (/home/ec2-user/pizza-luvrs/routes/index.js:25:10)
at startServer (/home/ec2-user/pizza-luvrs/index.js:12:10)
"@hapi/hapi": "^18.3.1", I used this version of the hapi in package.json and it worked fine. Just wanted to let you all know.
This is still not working for me. I tried changing the version as mentioned above
This error comes from a newer version of @hapi/hapi
and @hapi/joi
. You have to make sure your dependencies match what is in the included package.json
.