Documentation
Feedback
Guides
Troubleshooting

Troubleshooting
Development
I can't install VTEX IO CLI

When installing VTEX IO CLI, there is the error "Error: Cannot find module vtex."

Keywords: VTEX IO CLI | Plugins

When installing VTEX IO CLI, I receive 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 are failing 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 version available.
  2. If not, consider updating it.
  3. If the problem continues, you need to follow the steps below according to 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.

    2. Copy the path. In the example below, C:\Users\Barbara Celi\AppData\Local\Yarn\bin

      {"base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABCAIAAAB2XpiaAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAFklEQVR4nGPYvHndy5cvt23bxsnJCQA3pgcNEXD3xAAAAABJRU5ErkJggg==","img":{"src":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/docs/troubleshooting/development/windows-yarn-global-bin.png","width":480,"height":108,"type":"png"}}

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

    4. Click Open.

      {"base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAACCAIAAADwyuo0AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAI0lEQVR4nGPYsGbd7o2bvv//f/nKFQYtHV0WBgZtLW1FZRUAwQALCH++M9cAAAAASUVORK5CYII=","img":{"src":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/docs/troubleshooting/development/windows-search-en.png","width":1114,"height":534,"type":"png"}}

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

      {"base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAECAIAAADETxJQAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAM0lEQVR4nAEoANf/AEpISUdAQXZ3eACysrLr7Ozs7e4Azs3O4N7fzsrKALu7u4WBgSgeHq5zFi2qaFDGAAAAAElFTkSuQmCC","img":{"src":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/docs/troubleshooting/development/environment-variables-en.png","width":606,"height":705,"type":"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":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAP0lEQVR4nAE0AMv/AAwFDykuN1tia6KnqgC5uLnExcnGx8vo6esAZFhYtq+v2dLS0MzKAK2trbe2tsnIyM/Pz6XNHlUEDp5hAAAAAElFTkSuQmCC","img":{"src":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/docs/troubleshooting/development/system-variables-en.png","width":868,"height":951,"type":"png"}}

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

      {"base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAP0lEQVR4nAE0AMv/ABsbGzQ2NnFxcUY7OgC6urnNzczX19dycnMA4uLi////9fX1enp6AK+vr7i5ubi5uXp6ephuHS58dilpAAAAAElFTkSuQmCC","img":{"src":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/docs/troubleshooting/development/new-variable-en.png","width":738,"height":805,"type":"png"}}

    8. Paste the path you 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 continues, open a support ticket.

Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
Was this helpful?
Yes
No
Suggest edits (Github)
Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
On this page