mashery / iodocs

Interactive API documentation system
MIT License
1.89k stars 415 forks source link

Exception in file read #225

Open neerajkumaragarwal1990 opened 9 years ago

neerajkumaragarwal1990 commented 9 years ago

On mac, when I do npm start, I get this error.

File /Users/abc/projects/iodocs/config.json not found or is invalid. Try: cp config.json.sample config.json

I tried printing the exception, it says [TypeError: Property 'minify' of object # is not a function]

I did npm install properly, I tried installing the node-json-minify manually as well, but still doesn't work. I tried using https://github.com/getify/JSON.minify on node command line as well, but it doesn't work as well. Should I try some other version of node-json-minify? It is set to 0.1.x right now in package.json

phairow commented 9 years ago

I haven't seen this one before. If you have created the config.json file then this error should go away. Might be a permission issue so check that too. Also, make sure you installed all the dependencies including redis.

neerajkumaragarwal1990 commented 9 years ago

I am able to read the file and print it in the same code. The only problem is the 'minify' module it seems.

rubyisbeautiful commented 9 years ago

I am getting this as well on Mac OS X 10.10.1. I am not very learned with node and npm. I cloned the repo, followed the directions in the README (npm install; cp config.json), and get the same error:

$ npm start

> iodocs@0.0.1 start /Users/bryan/apps/iodocs
> supervisor -e 'js|json' app

Running node-supervisor with
  program 'app'
  --watch '.'
  --extensions 'js|json'
  --exec 'node'

Starting child process with 'node app'
Watching directory '/Users/bryan/apps/iodocs' for changes.
File /Users/bryan/apps/iodocs/config.json not found or is invalid.  Try: `cp config.json.sample config.json`
Program node app exited with code 1

Here are my dependency versions:

iodocs$ node --version
v0.10.33
iodocs$ npm --version
2.1.11
iodocs$ redis-server --version
Redis server v=2.8.17 sha=00000000:0 malloc=libc bits=64 build=97eed77a40720341
iodocs$ redis-cli --version
redis-cli 2.8.17

I also attempted a clean install and run on Ubuntu 14.04 (via Docker), and it worked perfectly:

root@ffec822bc959:~/iodocs# node --version v0.10.33 root@ffec822bc959:~/iodocs# npm --version 1.4.28


Is there anything else I can provide that would be helpful?  Thank you
ArVan commented 9 years ago

It is a bug in node-json-minify module. The version 0.1.1 has a bug in it. Unfortunately their versioning is made so, that the dependency in iodocs can't get a newer version of it. This can be fixed by changing the version in package.json to "node-json-minify": ">= 0.1.3-a",. This will install a newer version of minify.

neerajkumaragarwal1990 commented 9 years ago

@ArVan That solves it!

amilkr commented 9 years ago

It should be fixed.

chipironcin commented 9 years ago

It is still not fixed. Is there anyone managing the repo? Maybe a line in FAQ or warning in README.md will do the trick for new installs.

nnoco commented 9 years ago

@chipironcin Did you run "npm install" after to modify config.json?

nnoco commented 9 years ago

@ArVan Thank you! That solves it!