docsify-cli: Bug: /usr/bin/env: ‘node\r’: No such file or directory
After the installation, I try to run docsify. However, there’s an error saying /usr/bin/env: ‘node\r’: No such file or directory.
Finally, I found the solution to the problem.
Just to use dos2unix to convert /use/local/lib/node_modules/docsify-cli/bin/docsify to Unix format.
Maybe it is the format(dos) of the file that cause the problem.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 13
- Comments: 37 (15 by maintainers)
You can simply cd to /usr/local/lib/node_modules/docsify-cli/bin and open docsify with vim
sudo vim docsifythen you can fix the line endings of the file with:set ff=unixthen save and quit:wqand everything should be fine!By this month for sure !!!
Ahh it works thank you much.
If you install it using yarn, the solution of @Rabbitzzc works with additional step
Updating using vscode
Then in vscode, make sure that the line-ending is set to
LF. If not, simply click theCRLFand change toLF. You can see it on the bottom right of the IDEThis has blocked several of my users from contributing to our docs.
As a temporary workaround, I published
docsify-cli-hotfixwhich is just a built release ofmasterincluding this fix.Then just use the
docsifycommand normally.Maintainers, please publish an official patch release for this.
Doing
Fixe it for me. Thx @nsainaney
Yup, lets keep it open until the release
I do use yarn. I downgraded to 4.3.0 to get around the issue
This error occurs only when you use
yarninstead ofnpmto install the package.yeah, there are also ways to fix it with vim, but we need this cross-platform. 😃
This issue will be fixed as soon the a new version gets launch.
Thanks @anikethsaha for the feedbacks
Will do! Thanks @anikethsaha
I just opened
node_modules/.bin/docsify, save the file and It’s works again.But it’s indeed annoying.
I’m experiencing this issue as well. It’s because the file
node_modules/docsify-cli/bin/docsifyhas CRLF line endings instead of LF (\r instead of \n) with are Windows line endings. You can fix this locally by finding the docsify file locally (which docsify) and changing the line endings using an editor like vscode or something like dos2unix.I can’t submit a PR because the repo is correct but somehow, the npm package is messed up.
This is what I see for the bin file in vscode. See the highlight in the bottom right: