簡體   English   中英

apm(atom的包管理器)啟動shell運行錯誤

[英]the apm(the package manager of atom) start shell run error

我正在處理osx 10.11系統中apm的錯誤。 當我跑步

apm

在我的命令行中,由於文件路徑錯誤而引發錯誤:

/usr/local/bin/apm: line 32: /Applications/Atom.app/Contents/Resources/app/apm/node_modules/.bin/node: No such file or directory

簽出后,我發現:在apm shell(/Atom.app/Contents/Resources/app/apm/node_modules/.bin/apm)中,有一個while循環:

while [ -L "$binDir" ]
do
  binDir=`readlink "$binDir"`
  builtin cd "`dirname "$binDir"`"
  binDir=`basename "$binDir"`
done

似乎此循環僅在我的osx系統上運行一次,而在其他osx系統上運行兩次,因此出現的錯誤就是因為這個原因。

-L檢查文件是否是符號鏈接,如果是,則返回True。 通過man test

   -L FILE
          FILE exists and is a symbolic link (same as -h)

查看一個示例,其中我們創建一個文件hello和一個名為my_link的(軟)鏈接:

$ touch hello
$ ln -s hello my_link
$ [ -L "hello" ] && echo "this is a link" || echo "this is NOT a link"
this is NOT a link
$ [ -L "my_link" ] && echo "this is a link" || echo "this is NOT a link"
this is a link

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM