Issue with "Compress"
Closed this issue · 3 comments
I'm getting this issue (that I need to install "compress"). Thanks so much for making your work available Jeff, I really want to learn Node and to learn how to use Mysql/MariaDB with it and yours is one of the few examples available.
user1@test:~/workspace/mean-stack-relational-master$ grunt
Running "jshint:all" (jshint) task
22 files lint free.
Running "concurrent:tasks" (concurrent) task
Running "nodemon:dev" (nodemon) task
Running "watch" task
Waiting...
[nodemon] v1.0.17
[nodemon] to restart at any time, enter rs
[nodemon] watching: /home/user1/workspace/mean-stack-relational-master/app//* /home/user1/workspace/mean-stack-relational-master/config//*
[nodemon] starting node app.js
Initializing Sequelize
Loading model file Article.js
Loading model file user.js
Initializing Express
Error: Most middleware (like compress) is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.
at Function.Object.defineProperty.get (/home/user1/workspace/mean-stack-relational-master/node_modules/express/lib/express.js:89:13)
at module.exports (/home/user1/workspace/mean-stack-relational-master/config/express.js:19:21)
at Object. (/home/user1/workspace/mean-stack-relational-master/app.js:23:28)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:901:3
[nodemon] app crashed - waiting for file changes before starting...
I ran "npm install compress" and "npm install connect" and "npm update" and then ran "grunt" again and got the same error as above.
I see in file /home/user1/workspace/mean-stack-relational-master/config/express.js the line:
app.use(express.compress({
and from looking at the connect site, I think compress is no longer included in express and is also now called compression? I'll tinker with this and update my post.
This look like an Express.js error.
I think the first thing you could do is go into the package.json and remove the 'latest' version for the express module. I would revert back to a previous version of express and see if that fixes things.
That did it, yay! Yours is the first complete working example of what I want to learn. Thanks a lot!
No problem @NaturalBridge I am happy to help. If you want to create a pull request with those changes in the package.json it would be greatly appreciated.