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

Using the npm published version of nano-server on a Unix-based system fails #7

Closed
PaulMougel opened this issue Aug 11, 2014 · 5 comments

Comments

@PaulMougel
Copy link
Contributor

While trying to use nano-server to serve static files for Brain Browser:

$  nano-server 5000 ./examples
env: node\r: No such file or directory

This happens because the files are saved in DOS format (see npm/npm#2097), which unfortunately screws the shebang…

Edit: I tried to fork the repository and fix the line-endings, but it turns out they are fine! Only the files published on npm are messed up. So I guess re-publishing from a UNIX computer should be enough to fix the issue.


For people encountering the same issue, here is how I fixed it.

The package was installed using npm i -g nano-server, so I edited the file where the program was loaded from:

$ vim $(which nano-server)

just enter :set ff=unix, save the file and voilà!

@tsherif
Copy link
Owner

tsherif commented Aug 11, 2014

Oh! Thanks for looking into this. It's funny. It seems to work fine on Linux for me, but not on Mac. Either way, I'll republish from a Linux machine today or tomorrow, so hopefully that will fix this.

@PaulMougel
Copy link
Contributor Author

Oh, so it works on Linux… seems like I was a bit over-zealous by saying "UNIX-based systems"!

@PaulMougel PaulMougel changed the title Using nano-server on a UNIX-based system fails Using nano-server on a Mac fails Aug 11, 2014
@PaulMougel PaulMougel changed the title Using nano-server on a Mac fails Using the npm published version of nano-server on a Mac fails Aug 11, 2014
@tsherif
Copy link
Owner

tsherif commented Aug 11, 2014

Oh, wait... you were right. I was using an old, Linux-published version. I just did an update (to a version I published in Windows) and now it fails. I'll fix the title of this thread and try to re-publish today.

@tsherif tsherif changed the title Using the npm published version of nano-server on a Mac fails Using the npm published version of nano-server on a Unix-based system fails Aug 11, 2014
@tsherif
Copy link
Owner

tsherif commented Aug 11, 2014

@PaulMougel I just published an update to NPM. Can you verify that it works for you?

@PaulMougel
Copy link
Contributor Author

$ nano-server 5000
nano-server v0.3.2 running in '.' started on port 5000.

👍

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

No branches or pull requests

2 participants