0

adding node.js directory to cygwin path breaks the ls command:

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

Of course the node dir contains nothing looking like "ls":

as shown by the following in a new cygwin terminal:

$ 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 Answer 1

1

In the assignment, you need $PATH instead of %PATH%. The former syntax is used by *nix systems, and the latter by Windows CMD. Cygwin emulates POSIX environments, so the former syntax is required.

The current statement assigns the literal string '%PATH%' to the path variable, making it unable to find the /usr/bin/ls command.

1
  • my bad, thanks ! Commented Jan 27, 2022 at 19:22

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.