Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

env: node\r: No such file or directory #5

Open
robertoestivill opened this issue May 20, 2016 · 8 comments
Open

env: node\r: No such file or directory #5

robertoestivill opened this issue May 20, 2016 · 8 comments
Assignees
Labels

Comments

@robertoestivill
Copy link

robertoestivill commented May 20, 2016

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

@amortka
Copy link

amortka commented May 21, 2016

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.

@robertoestivill
Copy link
Author

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

@amortka
Copy link

amortka commented May 21, 2016

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.

@robertoestivill
Copy link
Author

robertoestivill commented May 22, 2016

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

@kamilzasada
Copy link
Contributor

@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 👍

@robvanmieghem
Copy link

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.

@svallory
Copy link

Fixed by running...

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

@madmuffin1
Copy link

madmuffin1 commented Jul 8, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants