Devendra Verma Devendra Verma - 2 months ago 16
Git Question

Cannot find module sails-swagger

I have installed a package using

npm install https://github.com/langateam/sails-swagger.git --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

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 https://github.com/langateam/sails-swagger#configuration
  5. sails lift and visit localhost:1337/swagger/doc
Comments