yarn global upgrade installing dependencies in the global folder

Created on 2 Mar 2018  路  3Comments  路  Source: yarnpkg/yarn

What is the current behavior?
yarn global upgrade is installing dependencies of installed packages in the global folder.

If the current behavior is a bug, please provide the steps to reproduce.

yarn global add resin-cli
cat $(yarn global bin)/sudo -> No such file or directory

yarn global upgrade
cat $(yarn global bin)/sudo -> *js code output*

yarn global remove resin-cli
cat $(yarn global bin)/sudo -> No such file or directory

yarn global add resin-cli
cat $(yarn global bin)/sudo -> No such file or directory

What is the expected behavior?
yarn global upgrade should not install dependencies or optionalDependencies in the global folder

Please mention your node.js, yarn and operating system version.

node -v -> v8.8.1
yarn --version -> 1.5.1
sw_vers -> ProductName: Mac OS X - ProductVersion: 10.13.1  - BuildVersion: 17B1003

* additional detaisl *
yarn global list before the execution of yarn global upgrade:

yarn global v1.5.1
info "@vue/[email protected]" has binaries:
   - vue
info "[email protected]" has binaries:
   - ava
info "[email protected]" has binaries:
   - browser-sync
info "[email protected]" has binaries:
   - docsify
info "[email protected]" has binaries:
   - grunt
info "[email protected]" has binaries:
   - nyc
info "[email protected]" has binaries:
   - poi
info "[email protected]" has binaries:
   - resin
info "[email protected]" has binaries:
   - serve
info "[email protected]" has binaries:
   - webpack-bundle-analyzer

yarn global list after the execution of yarn global upgrade

info "@vue/[email protected]" has binaries:
   - vue
info "[email protected]" has binaries:
   - ava
info "[email protected]" has binaries:
   - browser-sync
info "[email protected]" has binaries:
   - docsify
info "[email protected]" has binaries:
   - grunt
info "[email protected]" has binaries:
   - nyc
info "[email protected]" has binaries:
   - poi
info "[email protected]" has binaries:
   - resin
info "[email protected]" has binaries:
   - serve
info "[email protected]" has binaries:
   - webpack-bundle-analyzer

yarn_global_upgrade_output.txt

triaged

Most helpful comment

I think I just encountered the same problem. I was wondering why the touch command on my linux system suddenly behaves strange and found out that it was replaced by a Node.js application which was installed in Yarn's global module folder (Yeah, I know my PATH variable is/was in wrong order...).

I can reproduce it like this:

  • Run yarn global add typings.
  • Check the user bin folder, only one binary link was created for the typings program. So everything is fine.
  • Run yarn global upgrade.
  • Check the user bin folder again. Now there is also is-ci, loose-envify, rc, rimraf, semver, touch, tsc, tsserver and which. This should not be the case.

All 3 comments

I think I just encountered the same problem. I was wondering why the touch command on my linux system suddenly behaves strange and found out that it was replaced by a Node.js application which was installed in Yarn's global module folder (Yeah, I know my PATH variable is/was in wrong order...).

I can reproduce it like this:

  • Run yarn global add typings.
  • Check the user bin folder, only one binary link was created for the typings program. So everything is fine.
  • Run yarn global upgrade.
  • Check the user bin folder again. Now there is also is-ci, loose-envify, rc, rimraf, semver, touch, tsc, tsserver and which. This should not be the case.

Any update on this?

Same problem

Was this page helpful?
0 / 5 - 0 ratings