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

标签 node.js windows ubuntu apt-get windows-subsystem-for-linux

Windows 10 Pro Insider Preview(内部版本 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(内部版本 14316)被标记为测试版。原因见下https://blogs.windows.com/buildingapps/2016/03/30/run-bash-on-ubuntu-on-windows/ .

it’s marked as beta for a reason: We know that there are some rough edges and that some things will break! Do not expect every Bash script and tool that you run will work perfectly – there will be gaps. But by trying out this feature, you’ll help us figure out what we need to work on in order to greatly improve our reliability, coverage, and reach.

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

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

关于node.js - 在 Windows 10 上的 ubuntu 上的 bash 上安装 azure-cli 后无法通过 NodeJs 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36659203/

相关文章:

javascript - ejs获取嵌套对象

node.js - 蒙戈错误: query selector must be an object

node.js - watchify 错误 - npm 错误!缺少脚本 : watch

windows - DLL 文件到底是什么,它们是如何工作的?

c - 使用 Windows MiniFilter 驱动程序拦截进程访问

linux - HiveMQ systemctl 服务不监听端口

node.js - 我的 Mongoose 数据播种脚本有什么问题?

windows - Dropbox 是如何实现这两个功能的(更改图标和仅发送文件更改的差异。)

bash - TAB 补全和 mc 问题

ruby-on-rails - 如何启动 rails server localhost :3000 on ubuntu 12. 04