0

刚刚安装了 node.JS,所以我可以在 CentOS 6.3 机器上安装 Azure cmd line 工具。据此,“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 ~]$ 
4

2 回答 2

1

我实际上在 Gentoo 上使用 Node v0.9.0。

每当我尝试运行“azure”时,都会遇到同样的错误。但是,我可以 cd 进入 azure-sdk...\bin 文件夹,然后运行“node azure”,它工作正常。

后来我看到你的帖子,它也很好用。

谢谢

于 2012-09-14T15:09:06.763 回答
1

好的,问题原来是使用字符串“/usr/bin/node\r”调用 execve() 的“天蓝色”。

一种解决方法是这样做:

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

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

于 2012-09-08T22:35:20.910 回答