繁体   English   中英

在 Windows 10 上的 ubuntu 上的 bash 上安装 azure-cli 后,无法通过 NodeJs 错误

[英]Can't get past NodeJs-error after installing azure-cli on bash on ubuntu on windows 10

Windows 10 Pro Insider Preview (Build 14316) 包含 Ubuntu。 使用 APT-Get 我已经安装了各种软件包,比如 git 和 fish。

我还尝试使用以下方法安装 Microsoft Azure 命令行工具:

sudo apt-get install nodejs-legacy
sudo apt-get install npm
sudo npm install -g azure-cli

有一次,我什至破坏了我的系统。 我给出的每个命令都返回如下内容:

udev requires devtmpfs support, not started ...fail! invoke-rc.d: initscript udev, action "restart" failed. dpkg: error processing package udev (--configure): subprocess installed post-installation script returned error exit status 1 dpkg: dependency problems prevent configuration of systemd-services: systemd-services depends on udev (>= 175-0ubuntu23); however: Package udev is not configured yet.

我可以用

cat > /usr/sbin/policy-rc.d <<EOF
#!/bin/sh
exit 101
EOF
chmod +x /usr/sbin/policy-rc.d
dpkg-divert --local --rename --add /sbin/initctl
ln -s /bin/true /sbin/initctl

(我发现在https://github.com/Microsoft/BashOnWindows/issues/143

然而。 我的文件路径中确实有“azure”,但是当我尝试执行它时,我的系统只返回一个错误:

root@localhost ~/n/azure-cli# azure
fs.js:584
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: Unknown system error -25: Unknown system error -25, open '/usr/local/lib/node_modules/azure-cli/bin/azure'
    at Error (native)
    at Object.fs.openSync (fs.js:584:18)
    at Object.fs.readFileSync (fs.js:431:33)
    at Object.Module._extensions..js (module.js:421:20)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)
    at startup (node.js:146:18)
    at node.js:404:3

所以这里我的问题:

  • 这个错误是什么意思?
  • 我该如何解决?

到目前为止,包含 Ubuntu 的 Windows 10 Pro Insider Preview (Build 14316) 被标记为测试版。 出于原因,请参阅以下https://blogs.windows.com/buildingapps/2016/03/30/run-bash-on-ubuntu-on-windows/

它被标记为测试版是有原因的:我们知道有一些粗糙的边缘,有些东西会破裂! 不要指望你运行的每个 Bash 脚本和工具都能完美运行——会有差距。 但是通过试用此功能,您将帮助我们弄清楚我们需要做什么,以大大提高我们的可靠性、覆盖范围和覆盖范围。

感谢您的尝试。 如果您有任何疑问,请继续通过Windows 命令行 UserVoice门户发布反馈或建议功能等。

现在我建议在 Windows 或 Linux(不是 WSL)上使用 azure-cli 进行工作。

在 Windows 10 Build 14366.rs1_release.160610-1700 中它起作用了! 我使用的命令:

apt-get uninstall npm
apt-get install npm
npm install azure -g
npm install azure-cli
azure

然而,它确实收到了很多警告:

npm WARN engine azure-cli@0.10.1: wanted: {"node":">= 4.2.4"} (current: {"node":"v0.10.25","npm":"1.3.10"})
...
npm WARN engine hawk@3.1.3: wanted: {"node":">=0.10.32"} (current: {"node":"v0.10.25","npm":"1.3.10"})
...
npm WARN engine cryptiles@2.0.5: wanted: {"node":">=0.10.40"} (current: {"node":"v0.10.25","npm":"1.3.10"})
npm WARN engine hoek@2.16.3: wanted: {"node":">=0.10.40"} (current: {"node":"v0.10.25","npm":"1.3.10"})
npm WARN engine boom@2.10.1: wanted: {"node":">=0.10.40"} (current: {"node":"v0.10.25","npm":"1.3.10"})
...
npm WARN engine galaxy@0.1.12: wanted: {"node":">=0.11.10"} (current: {"node":"v0.10.25","npm":"1.3.10"})

然而,最终 azure 命令行显示了它熟悉的 ascii-art:

info:             _    _____   _ ___ ___
info:            /_\  |_  / | | | _ \ __|
info:      _ ___/ _ \__/ /| |_| |   / _|___ _ _
info:    (___  /_/ \_\/___|\___/|_|_\___| _____)
info:       (_______ _ _)         _ ______ _)_ _
info:              (______________ _ )   (___ _ _)
info:
info:    Microsoft Azure: Microsoft's Cloud Platform
info:
info:    Tool version 0.10.1

在 windows 10 上的 unbuntu 上的 bash 上的鱼:-)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM