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:
- Run
vtex --versionto ensure you are using the latest version available. - If not, consider updating it.
- If the problem continues, you need to follow the steps below according to your operating system:
-
MacOS:
- Create a symlink from {vtex-folder}/node_modules/vtex to {vtex-folder}/.
- Run the following command in the terminal:
_10ln -s /usr/local/Cellar/vtex/2.119.2/libexec /usr/local/Cellar/vtex/2.119.2/libexec/node_modules/vtex -
Linux:
- Create a symlink from {vtex-folder}/node_modules/vtex to {vtex-folder}/.
- Run the following command in the terminal:
_10ln -s /usr/local/lib/vtex /usr/local/lib/vtex/node_modules/vtex -
Windows
-
Run the
yarn global bincommand in your terminal. -
Copy the path. In the example below,
C:\Users\Barbara Celi\AppData\Local\Yarn\bin
-
In the Windows search bar, write Edit the system environment variables.
-
Click
Open.
-
In the System Properties settings, go to the Advanced section and click Environment Variables.

-
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.

-
In the Edit environment variable settings, click
New.
-
Paste the path you copied in step 2.
-
Click
OK.
If the error continues, open a support ticket.
-