ramlo icon indicating copy to clipboard operation
ramlo copied to clipboard

env: node\r: No such file or directory

Open robertoestivill opened this issue 8 years ago • 8 comments

Hello,

I'm having the following issue on OSX:

rober@localhost:/docs $ ramlo -f my-api.raml 
env: node\r: No such file or directory

I have tried installing ramlo as a regular user and as root, both resulting on the same error.

Any ideas? (im not a node dev) Thanks

robertoestivill avatar May 20 '16 20:05 robertoestivill

Hi Roberto, is it possible that .raml file has been created under windows and you are trying to generate docs on OXS? If so, please try to run in vim: :set ff=unix or in directory: cat my-api.raml | tr -d '\r' > my-api_fixed.raml (this will remove windows' carriage return sign) and let us know if that helps.

amortka avatar May 21 '16 16:05 amortka

Hi @amortka Nope. That's not the case. The file was created under osx. Regardless, I ran the command you mentioned, but the error still happens.

rober@localhost:/docs $ ramlo -f my-api.raml 
env: node\r: No such file or directory
rober@localhost:/docs $ cat my-api.raml | tr -d '\r' > my-api2.raml 
rober@localhost:/docs $ ramlo -f my-api2.raml 
env: node\r: No such file or directory

It looks like it might be something with the installation or binary, as just running the ramlo binary without any arguments results on the same error message

rober@localhost:/docs $ ramlo
env: node\r: No such file or directory

Thanks

robertoestivill avatar May 21 '16 19:05 robertoestivill

ok, so your .raml file is ok but probably sources of ramlo contains CR sign(s) and that causes the problem. I can check this on Monday as I don't have access to any mac right now. But it is definetely something worth checking.

You could do one more thing: remove \r sign from ramlo.js and src/modules/*.js with either vim:

:set ff=unix
[enter]
:x
[enter]

or with the same bash command. Hope it'll work, if not I will try to run it on OSX on my own.

amortka avatar May 21 '16 20:05 amortka

I cloned this repo, built it, and it worked as expected without having to run any of the above CR fixes. It looks like it might be a problem with the version deployed to the npm repository, from where I originally installed ramlo from.

rober@localhost:/ $ git clone https://github.com/PGSSoft/ramlo.git 
rober@localhost:/ $ cd ramlo/
rober@localhost:/ramlo $ npm install
rober@localhost:/ramlo $ chmod +x ramlo.js
rober@localhost:/ramlo $ ./ramlo.js -f /docs/my-api.raml - o /docs/my-api.html
starting ramlo...
time: 532.043ms
finished

robertoestivill avatar May 22 '16 19:05 robertoestivill

@robertoestivill thanks for reporting an issue. i'll look at this in the next days. development of this tool is still in progress, so if you will report other problems feel free to contact us :+1:

kamilzasada avatar May 23 '16 17:05 kamilzasada

The problem is that the npm installer installs ramlo with dos line endings ( \r\n ). This is no problem on windows but fails on osx or unix.

robvanmieghem avatar Jun 06 '16 14:06 robvanmieghem

Fixed by running...

vim $(which ramlo)
:set ff=unix
:x

svallory avatar Jun 20 '16 06:06 svallory

The whole repository contains \r\n line endings, which is rather uncommon in the git world (for good reason).

A .gitattributes file should be installed, similar to this one:

* text=auto

This will store the files with \n in git, but convert it to \r\n when checkout out on windows. See the documentation at https://help.github.com/articles/dealing-with-line-endings/#platform-all for more information

madmuffin1 avatar Jul 08 '16 09:07 madmuffin1