`無伺服器登入`回傳錯誤:spawn /home/imin/.serverless/bin/xdg-open ENOENT

`無伺服器登入`回傳錯誤:spawn /home/imin/.serverless/bin/xdg-open ENOENT

作為 Linux 新手,我嘗試在我的 VMware 中安裝 lubuntu-18.04.4-desktop-amd64 來在那裡進行開發工作。安裝很簡單,現在我正在嘗試按照此處的指南安裝無伺服器https://serverless.com/framework/docs/getting-started/

我執行命令curl -o- -L https://slss.io/install | bash安裝 Serverles 沒有任何問題。安裝後,我關閉了終端並打開了一個新終端,我可以serverless毫無問題地運行命令。但是,當我嘗試執行此命令時serverless login,它將顯示:

Serverless: Logging you in via your default browser...
If your browser does not open automatically, please open it &  open the URL below to log in:
https://serverlessinc.auth0.com/authorize?blablabla

Error: spawn /home/imin/.serverless/bin/xdg-open ENOENT
      at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
      at onErrorNT (internal/child_process.js:469:16)
      at processTicksAndRejections (internal/process/task_queues.js:84:21)

     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

  Your Environment Information ---------------------------
     Operating System:          linux
     Node Version:              12.16.1
     Framework Version:         1.67.3 (standalone)
     Plugin Version:            3.6.6
     SDK Version:               2.3.0
     Components Version:        2.29.0

我檢查了內部/home/imin/.serverless/bin/,找不到 xdg-open ,所以我運行sudo apt-get install --reinstall xdg-utils,關閉並重新打開終端,然後serverless login再次運行命令,但仍然顯示相同的錯誤。作為一個認為我的 lubuntu 安裝有問題的新手,我下載了 linux mint xcfe 並嘗試安裝無伺服器並運行相同的命令,但不,瞧,得到了相同的錯誤。

我該怎麼辦?謝謝

答案1

我透過找到 xdg-open 解決了這個問題

which xdg-open

然後在需要的地方創建符號鏈接

ln -s /usr/bin/xdg-open /home/USER/.serverless/bin/xdg-open

沒有問題後

相關內容