ashleydavis / mongodb-rest

REST Server for MongoDB (using node.js)
GNU Lesser General Public License v3.0
75 stars 34 forks source link

Windows-style carriage return error #6

Closed sarahghp closed 9 years ago

sarahghp commented 9 years ago

When I attempt to run mongodb-rest from the command line, I get the following error:

env: node\r: No such file or directory

Googling suggests this is an issue with DOS file encodings. For instance.

I can work around it, but it should probably be updated.

sarahghp commented 9 years ago

In the meantime, this fix works, if anyone else needs it: https://github.com/mllrsohn/node-webkit-builder/issues/75#issuecomment-73423916

ashleydavis commented 9 years ago

So do I need to convert it to Unix line endings?

sarahghp commented 9 years ago

That's probably the easiest option. You could put the burden on users and note it in the read me, plus encourage people to download and use dos2unix, but just fixing it and pushing an updated package to npm is probably easiest.

sarahghp commented 9 years ago

If you do push a new package, you should also add this line to the package.json:

"main": "server.js"

Right now, since the entry point isn't the default index.js, requiring the server instead of starting it on the command line fails.

ashleydavis commented 9 years ago

I've set "main" to "server.js". Please take a look a let me know if this is what you wanted.

ashleydavis commented 9 years ago

I've tried convert to Unix line endings, but only one file actually got changed. I used Sublime Text to make the changes. Did this do what you want?

sarahghp commented 9 years ago

It looks like you changed it in access-control. It is bin where I was running into trouble.

ashleydavis commented 9 years ago

Hmm... I try changing it in sublime but there is nothing to commit!

If you wanted to fork it and I'll change it I'll be happy to merge your change back.