Open christopher-besch opened 2 years ago
This problem is related: https://github.com/yarnpkg/yarn/issues/8106
Strangely, the file on GitHub appears to use LF endings, but the one that appears in node_modules
installed from the npm Registry uses CRLF. I tried to fork & fix the issue, but I see LF already there in the source. Maybe something weird happened during the latest publish?
So, another workaround is to list the latest version from GitHub as a dependency:
"devDependencies": {
"live-server": "git+https://github.com/tapio/live-server.git#ad22544",
}
yarn global add git+https://github.com/tapio/live-server.git#ad22544
fixes the issue.
Thanks a lot, @mattrossman!
Happen to me as well, the issue doesn't happen with previous version 1.2.1
@tapio could you please re-publish the latest version without changing the line endings? I was bitten by this again when installing on a new machine.
yarn global add git+https://github.com/tapio/live-server.git#ad22544
fixes the issue.
For zsh
you need quotes.
yarn global add 'git+https://github.com/tapio/live-server.git#ad22544'
for npm package manager:
apt-install dos2unix
dos2unix /usr/local/lib/node_modules/live-server/*
1.2.1 is fine, 1.2.2 is broken
npm i -g live-server@1.2.1
It seems that 1.2.2
was published from a machine using CRLF line endings. Version 1.2.1
indeed works. PR #404 should prevent these in future.
$ grep version node_modules/live-server/package.json "version": "1.2.2", $ file node_modules/.bin/live-server node_modules/.bin/live-server: a /usr/bin/env node script text executable, ASCII text, with very long lines (374), with CRLF line terminators $ grep version node_modules/live-server/package.json "version": "1.2.1", $ file node_modules/.bin/live-server node_modules/.bin/live-server: a /usr/bin/env node script text executable, ASCII text, with very long lines (374)
I guess this package is published from local machine instead of CI? That's not good...
It seems that
1.2.2
was published from a machine using CRLF line endings. Version1.2.1
indeed works. PR #404 should prevent these in future.
Should this be merged?
Just ran into this as well. Pinning to 1.2.1
as suggested resolved the issue for me.
Running into this... was in 1.2.2, also in 1.2.1, but only when using the --port option...? on a linux machine. doesn't seem to be a problem for coworker on his windows machine.
The file
/home/chris/.config/yarn/global/node_modules/live-server/live-server.js
seems to be using Windows line endings (\r\n
). Runningdos2unix
on this file fixes the issue. I installed live-server withyarn global add live-server
and yarn version1.22.17
.Software details
live-server
:live-server
Gentoo Base System release 2.7
v14.19.0
live-server
version:1.2.2
This might be a problem with yarn on Gentoo. Thanks for your help!