gpt4 book ai didi

linux - Azure CLI 工具无法在 CentOS 6.3 上运行(找不到/usr/bin/node)——解决方法?

转载 作者:太空宇宙 更新时间:2023-11-04 09:49:48 24 4
gpt4 key购买 nike

刚刚安装了node.JS,这样我就可以在 CentOS 6.3 计算机上安装 Azure 命令行工具。据此,“azure”调用“node”存在问题(根据 strace)。由于 MSFT 根本不支持 Azure,显然,我想知道谁会收到这样的错误报告,还有其他人有解决方案吗?

[murphstein@localhost ~]$ which node
/usr/bin/node
[murphstein@localhost ~]$ which azure
/usr/bin/azure
[murphstein@localhost ~]$ ls -l /usr/bin/{azure,node}
lrwxrwxrwx. 1 root root 35 Sep 8 13:57 /usr/bin/azure -> ../lib/node_modules/azure/bin/azure
lrwxrwxrwx. 1 root root 8 Sep 8 13:56 /usr/bin/node -> ./nodejs
[murphstein@localhost ~]$ strace /usr/bin/azure
execve("/usr/bin/azure", ["/usr/bin/azure"], [/* 38 vars */]) = 0
brk(0) = 0x1160000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f5928bd9000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=49164, ...}) = 0
mmap(NULL, 49164, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f5928bcc000
close(3) = 0
open("/lib64/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360\355\1\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1912432, ...}) = 0
mmap(NULL, 3741864, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f5928629000
mprotect(0x7f59287b2000, 2093056, PROT_NONE) = 0
mmap(0x7f59289b1000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x188000) = 0x7f59289b1000
mmap(0x7f59289b6000, 18600, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f59289b6000
close(3) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f5928bcb000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f5928bca000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f5928bc9000
arch_prctl(ARCH_SET_FS, 0x7f5928bca700) = 0
mprotect(0x7f59289b1000, 16384, PROT_READ) = 0
mprotect(0x7f5928bda000, 4096, PROT_READ) = 0
munmap(0x7f5928bcc000, 49164) = 0
brk(0) = 0x1160000
brk(0x1181000) = 0x1181000
open("/usr/lib/locale/locale-archive", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=99158576, ...}) = 0
mmap(NULL, 99158576, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f5922798000
close(3) = 0
execve("/usr/local/bin/node\r", ["node\r", "/usr/bin/azure"], [/* 38 vars */]) = -1 ENOENT (No such file or directory)
execve("/usr/bin/node\r", ["node\r", "/usr/bin/azure"], [/* 38 vars */]) = -1 ENOENT (No such file or directory)
execve("/bin/node\r", ["node\r", "/usr/bin/azure"], [/* 38 vars */]) = -1 ENOENT (No such file or directory)
execve("/usr/local/sbin/node\r", ["node\r", "/usr/bin/azure"], [/* 38 vars */]) = -1 ENOENT (No such file or directory)
execve("/usr/sbin/node\r", ["node\r", "/usr/bin/azure"], [/* 38 vars */]) = -1 ENOENT (No such file or directory)
execve("/sbin/node\r", ["node\r", "/usr/bin/azure"], [/* 38 vars */]) = -1 ENOENT (No such file or directory)
execve("/home/murphstein/bin/node\r", ["node\r", "/usr/bin/azure"], [/* 38 vars */]) = -1 ENOENT (No such file or directory)
write(2, "/usr/bin/env: ", 14/usr/bin/env: ) = 14
) = 5e
open("/usr/share/locale/locale.alias", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=2512, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f5928bd8000
read(3, "# Locale name alias data base.\n#"..., 4096) = 2512
read(3, "", 4096) = 0
close(3) = 0
munmap(0x7f5928bd8000, 4096) = 0
open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, ": No such file or directory", 27: No such file or directory) = 27
write(2, "\n", 1
) = 1
close(1) = 0
close(2) = 0
exit_group(127) = ?
[murphstein@localhost ~]$

最佳答案

好的,问题出在“azure”使用字符串“/usr/bin/node\r”调用 execve()。

解决方法是这样做:

% cd /usr/bin
% sudo ln -s ./nodejs ./node^V^M

是的,在文件名末尾添加 DOS 回车符(即 Ctrl-V Ctrl-M)可以解决这个问题,但谁知道接下来会发生什么。我至少能够导入我的订阅信息,并且“azure”子命令到目前为止似乎可以正常工作。

关于linux - Azure CLI 工具无法在 CentOS 6.3 上运行(找不到/usr/bin/node)——解决方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12334629/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com