/usr/bin/env: ‘node\r’: No such file or directory
2022/1/6 22:04:17
本文主要是介绍/usr/bin/env: ‘node\r’: No such file or directory,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
同步链接: https://www.shanejix.com//usr/bin/env: ‘node\r’: No such file or directory/
执行 npm scripts
命令突然报错如下:
xx@ling:/usr/github_reps/block-ui# yarn run build:esm yarn run v1.22.10 $ block-scripts build:component:esm /usr/bin/env: ‘node\r’: No such file or directory error Command failed with exit code 127. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
有效信息在第四行 /usr/bin/env: ‘node\r’: No such file or directory
没错~ 后面为啥多了个 \r
回想起当前项目跨平台在开发。Linux 和 Window 都在陆续 pull && push 代码,\r 字符很容易联想到 [End Of Line Sequence]。
随即用 VScode 查看了下,项目文件
node_modules 下执行代码文件
在 linux 环境下统一为 LF 后 scripts 命令成功运行!
CRLF and LF
**CRLF / LF 分别是 Window 和 Unix 系统采用的 ** End Of Line(EOF) 换行符
CR = Carriage Return (\r, 0x0D in hexadecimal, 13 in decimal) — moves the cursor to the beginning of the line without advancing to the next line.
LF = Line Feed (\n, 0x0A in hexadecimal, 10 in decimal) — moves the cursor down to the next line without returning to the beginning of the line.
在打印机时代,使用 CR 把打印机指针移动到行首,LF 把指针往下移动一行。 Unix like 系统为了节省空间等原因里大多采用 LF(\n) 换行,而 Windows 中则延续了打字机时代使用 CRLF 换行。
references
- https://developer.mozilla.org/en-US/docs/Glossary/CRLF
作者:shanejix
出处:https://www.shanejix.com//usr/bin/env: ‘node\r’: No such file or directory/
版权:本作品采用「署名-非商业性使用-相同方式共享 4.0 国际」许可协议进行许可。
声明:转载请注明出处!
这篇关于/usr/bin/env: ‘node\r’: No such file or directory的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-10-04el-table 开启定时器下,表格的选中状态会消失是什么原因-icode9专业技术文章分享
- 2024-10-03如何安装和初始化飞牛私有云 fnOS?-icode9专业技术文章分享
- 2024-10-03如何安装 App 并连接到飞牛 NAS?-icode9专业技术文章分享
- 2024-10-03如何安装飞牛 TV 并连接到影视服务器?-icode9专业技术文章分享
- 2024-10-03如何在PVE和ESXI上安装飞牛私有云 fnOS?-icode9专业技术文章分享
- 2024-10-03fnOS国产最强NAS安装系统异常情况处理-icode9专业技术文章分享
- 2024-10-03飞牛NAS如何创建存储空间?-icode9专业技术文章分享
- 2024-10-03fnOS国产最强NAS硬盘会自动休眠吗?-icode9专业技术文章分享
- 2024-10-03fnOS国产最强NAS如何安装飞牛影视和创建媒体库?-icode9专业技术文章分享
- 2024-10-03fnOS国产最强NAS如何为家人朋友开通影视账号?-icode9专业技术文章分享