Documentation
Feedback
Guides
Troubleshooting

Troubleshooting
Development
I can't install VTEX IO CLI

When installing VTEX IO CLI, it returns "Error: Cannot find module vtex".

Keywords: VTEX IO CLI | Plugins

When installing VTEX IO CLI, I get the following error message: Error: Cannot find module ‘vtex’.

This error is related to plugins detached from the VTEX IO CLI base code.

Even though plugins are decoupled from VTEX IO CLI, they rely on the CLI features. Therefore, this error indicates that these plugins fail to access VTEX IO CLI features.

Solution

To solve this problem, follow these steps:

  1. Run vtex --version to ensure you are using the latest CLI version available.
  2. If not, consider updating it.
  3. If the problem persists, follow the steps below based on your operating system:
  • MacOS:

    1. Create a symlink from {vtex-folder}/node_modules/vtex to {vtex-folder}/.

    2. Run the following command in the terminal:


    _10
    ln -s /usr/local/Cellar/vtex/2.119.2/libexec /usr/local/Cellar/vtex/2.119.2/libexec/node_modules/vtex

  • Linux:

    1. Create a symlink from {vtex-folder}/node_modules/vtex to {vtex-folder}/.

    2. Run the following command in the terminal:


    _10
    ln -s /usr/local/lib/vtex /usr/local/lib/vtex/node_modules/vtex

  • Windows:

    1. Run the yarn global bin command in your terminal.

      The expected output is a path that indicates where globally installed Yarn packages are stored on your computer. It might follow the pattern: {UserProfileDirectory}\AppData\Local\Yarn\bin, where {UserProfileDirectory} refers to your user profile directory, typically found at C:\Users\{YourUserName} on Windows systems.

      In the example below, the output is C:\Users\Barbara Celi\AppData\Local\Yarn\bin

      {"base64":"  ","img":{"width":480,"height":108,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":11899,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/docs/troubleshooting/development/windows-yarn-global-bin.png"}}

    2. Copy the path that the terminal returned after running the yarn global bin command.

    3. In the Windows search bar, type Edit the system environment variables.

    4. Click Open.

      {"base64":"  ","img":{"width":1114,"height":534,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":316899,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/docs/troubleshooting/development/windows-search-en.png"}}

    5. In the System Properties settings, go to the Advanced section and click Environment Variables.

      {"base64":"  ","img":{"width":606,"height":705,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":25490,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/docs/troubleshooting/development/environment-variables-en.png"}}

    6. In the Environment Variables settings, double-click Path.

      If you want to configure the variables only for your user, click Path within User variables for {your.user}. If the configuration is for all system users, click Path within System variables.

      {"base64":"  ","img":{"width":868,"height":951,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":44696,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/docs/troubleshooting/development/system-variables-en.png"}}

    7. In the Edit environment variable settings, click New.

      {"base64":"  ","img":{"width":738,"height":805,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":28737,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/docs/troubleshooting/development/new-variable-en.png"}}

    8. Paste the path copied in step 2.

    9. Click OK.

      {"base64":"  ","img":{"width":747,"height":810,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":30980,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/docs/troubleshooting/development/new-variable-2-en.png"}}

    If the error persists, open a ticket with VTEX Support.

Contributors
3
Photo of the contributor
Photo of the contributor
Photo of the contributor
+ 3 contributors
Was this helpful?
Yes
No
Suggest Edits (GitHub)
Contributors
3
Photo of the contributor
Photo of the contributor
Photo of the contributor
+ 3 contributors
On this page