sindresorhus / pure

Pretty, minimal and fast ZSH prompt
MIT License
13.21k stars 976 forks source link

`/bin/sh: 1: npm: not found` when installing using Yarn #668

Closed LenaWil closed 11 months ago

LenaWil commented 11 months ago

General information

System report (output of prompt_pure_system_report):

zsh: command not found: prompt_pure_system_report

Other information

If you can't load Pure to create a system report, please report the following information:

I have:

Problem description

If one installs yarn and not npm it gives the following error:

➜  ~ yarn global add pure-prompt
yarn global v1.21.1
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
error /home/lena/.config/yarn/global/node_modules/pure-prompt: Command failed.
Exit code: 127
Command: if [ -e /opt/homebrew/bin/zsh ]; then PURE_DEST=/opt/homebrew/share/zsh/site-functions npm run --silent postinstall-link && exit 0; elif [ -e /usr/local/bin/zsh ]; then PURE_DEST=/usr/local/share/zsh/site-functions npm run --silent postinstall-link && exit 0; elif [ -e /bin/zsh ] || [ -e /usr/bin/zsh ]; then for dest in /usr/share/zsh/site-functions /usr/local/share/zsh/site-functions; do if [ -d $dest ]; then PURE_DEST=$dest npm run --silent postinstall-link && exit 0; fi; done; fi; PURE_DEST="$PWD/functions" npm run --silent postinstall-link && npm run --silent postinstall-fail-instructions
Arguments: 
Directory: /home/lena/.config/yarn/global/node_modules/pure-prompt
Output:
/bin/sh: 1: npm: not found
/bin/sh: 1: npm: not found
info Visit https://yarnpkg.com/en/docs/cli/global for documentation about this command.

Reproduction steps

  1. Install only yarn and not npm
  2. Execute yarn global add pure-prompt

My .zshrc:

I am pretty sure it isn’t relevant here since yarn isn’t zsh during the installation.

sindresorhus commented 11 months ago

I have clarified in the readme that Yarn is not supported. I'm not even sure how you managed to have Yarn but not npm, since npm comes with Node.js.