cygwin パスに node.js ディレクトリを追加すると、ls コマンドが中断されます。

cygwin パスに node.js ディレクトリを追加すると、ls コマンドが中断されます。

cygwin パスに node.js ディレクトリを追加すると、ls コマンドが中断されます。

Starting /bin/bash.exe

myidt@DESKTOP-IV5C6TI /cygdrive/d/tmp/node_ls_ko
$ touch toto

user@DESKTOP /cygdrive/d/tmp/node_ls_ko
$ ls
toto

user@DESKTOP /cygdrive/d/tmp/node_ls_ko
$ PATH=/cygdrive/d/brl/app/node-v14.17.6-win-x64:%PATH%

user@DESKTOP /cygdrive/d/tmp/node_ls_ko
$ ls
bash: ls : commande introuvable

もちろん、ノードディレクトリには「ls」などの内容は含まれていません。

新しいcygwin端末では:

$ ls /cygdrive/d/brl/app/node-v14.17.6-win-x64
asciidoctor-pdf          asciidoctor-web-pdf.ps1  install_tools.bat  node.exe               npm
asciidoctor-pdf.cmd      CHANGELOG.md             jhipster           node_etw_provider.man  npm.cmd
asciidoctor-pdf.ps1      inliner                  jhipster.cmd       node_modules           npx
asciidoctor-web-pdf      inliner.cmd              jhipster.ps1       nodevars.bat           npx.cmd
asciidoctor-web-pdf.cmd  inliner.ps1              LICENSE            nodevars_my.bat        README.md

ベストアンサー1

作業には$PATH代わりが必要です%PATH%。電子構文は *nix システムで使用され、後者は Windows CMD で使用されます。 CygwinはPOSIX環境をエミュレートするので、前の構文が必要です。

現在のステートメントは、リテラル文字列 "%PATH%"をパス変数に割り当てるため、コマンドが見つかりません/usr/bin/ls

おすすめ記事