Vue-storefront: NVM + yarn global add @vue-storefront/cli@next doesn't expose "vsf" binary

Created on 15 Sep 2020  路  2Comments  路  Source: DivanteLtd/vue-storefront

Current behavior

  1. Install yarn global add @vue-storefront/cli@next
  2. Run vsf
  3. Results in Command 'vsf' not found, did you mean: [...]

Expected behavior

  1. Install yarn global add @vue-storefront/cli@next
  2. Run vsf
  3. Results in ERROR VSF Provide command

Steps to reproduce the issue

Steps described above in Current behavior and Expected behavior sections

Version of Vue Storefront

  • [ ] Vue Storefront
  • [x] Vue Storefront Next

Can you handle fixing this bug by yourself?

  • [ ] YES
  • [x] NO

Environment details

  • OS: Ubuntu 18.04
  • Node: v14.5.0 and v14.10.1

Additional information

Problem does not occur when using NPM to install the CLI package.

Even though Yarn informs that the binary was installed, it's unavailable. Example installation log:

success Installed "@vue-storefront/[email protected]" with binaries:
      - vsf
bug

Most helpful comment

Please open terminal and run:

yarn global bin

Then:

echo $PATH;

I bet you do not have path to yarn global binaries in your $PATH - that's why you cannot run it from each place. More about this here

To solve this you should modify your $PATH variable. You could use (just tested it on Ubuntu 20.04):

export PATH="$(yarn global bin):$PATH"

Unfortunately, it will work only for the current terminal. If you want to have it permanently, you want to modify your ~/.bashrc. More about this here

All 2 comments

Please open terminal and run:

yarn global bin

Then:

echo $PATH;

I bet you do not have path to yarn global binaries in your $PATH - that's why you cannot run it from each place. More about this here

To solve this you should modify your $PATH variable. You could use (just tested it on Ubuntu 20.04):

export PATH="$(yarn global bin):$PATH"

Unfortunately, it will work only for the current terminal. If you want to have it permanently, you want to modify your ~/.bashrc. More about this here

@Fifciu Yep, that was the issue, thanks :slightly_smiling_face:

Was this page helpful?
0 / 5 - 0 ratings