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

Strange behavior in MacOS #782

Closed
davidjpfeiffer opened this issue Jan 9, 2022 · 7 comments
Closed

Strange behavior in MacOS #782

davidjpfeiffer opened this issue Jan 9, 2022 · 7 comments

Comments

@davidjpfeiffer
Copy link

davidjpfeiffer commented Jan 9, 2022

I have used this http server for years and never had any issues at all. All the sudden I went to install http-server on my new mac and I am unable to host a simple static HTML file. I am able to install the http-server package using NPM but then when I try to host a web server I see this strange behavior in terminal:

Screen Shot 2022-01-09 at 12 15 49 PM

Environment Versions

  1. MacOS Monterey: 12.1
  2. Node version: 16.13.1
  3. NPM version: 8.1.2
  4. http-server version: 14.0.0

Steps to reproduce

  1. npm i http-server
  2. npx http-server

Expected result

The web server gets hosted and the Terminal window shows network log info as usual

Actual result

The web server is not hosted and instead the terminal window spams endless unrecognizable characters as seen in the screenshot

Other information

I have tried using multiple different versions of the http-server package including versions 13.0.0 and much older versions but the behavior is the same. I tried using sudo when installing the http-server package but that did not change anything. I also tried giving my Terminal Full Disk Access and access to the Developer Tools but nothing I have tried changes the behavior.

@davidjpfeiffer
Copy link
Author

Just in case this is helpful information, I am able to download the Angular CLI using NPM and then create a new Angular project and host it on a local web server no problem on this same computer.

@BitesizedLion
Copy link

BitesizedLion commented Jan 9, 2022

This issue is due to the NPM module "colors", it's author went rogue and added an infinite for loop because he thought it would be funny, can be solved by pinning to version 1.4.0

"colors": "^1.4.0",

@davidjpfeiffer
Copy link
Author

@BitesizedLion thank you so much for responding, it was driving me crazy trying to figure out what was going on

@davidjpfeiffer
Copy link
Author

@davidjpfeiffer
Copy link
Author

If anyone else is impacted by this you can consider using https://www.npmjs.com/package/serve as an alternative

@mattdaviscodes
Copy link

mattdaviscodes commented Jan 9, 2022

Same problem.

EDIT: And pinning to that version doesn't help.

@thornjad
Copy link
Member

This is fixed in http-server v14.1.0 and backported to v13.1.0. It was indeed caused by Marak/colors.js#285, and we fixed it by switching out colors.js for chalk.

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

4 participants