Devendra Verma
Devendra Verma

Reputation: 1015

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.

Upvotes: 2

Views: 456

Answers (1)

DarkLeafyGreen
DarkLeafyGreen

Reputation: 70406

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

Upvotes: 1

Related Questions