Devendra Verma Devendra Verma - 11 months ago 86
Git Question

Cannot find module sails-swagger

I have installed a package using

npm install --save
. It installed successfully in the node_module folder of my current directory. But when I run the application then it shows error
Can not find module sails-swagger
I am using the sails js framework for node.

Answer Source

I tested it and faced the same problem. Luckily I was able to fix it.

  1. Remove node_modules rm -rf node_modules
  2. Add "sails-swagger": "0.5.1" to package.json
  3. run npm install
  4. Add config/swagger.js as described here
  5. sails lift and visit localhost:1337/swagger/doc