簡體   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