I get an error related to sub-packages @intlayer/*
This issue usually arises after updating the Intlayer packages.
Example of error message:
Copy the code to the clipboard
Copy the code to the clipboard
Copy the code to the clipboard
Reason
Base packages such as intlayer, react-intlayer, react-native-intlayer, vue-intlayer reuse the same sub-packages like @intlayer/config, @intlayer/core, @intlayer/types to avoid code duplication.
Between two versions, the exports of the sub-packages are not guaranteed to be the same. To limit this problem, intlayer pins the version of the sub-packages to the version of the main package.
Ex:intlayer@1.0.0uses@intlayer/config@1.0.0,@intlayer/core@1.0.0,@intlayer/types@1.0.0
(Except for@intlayer/swc),@intlayer/*sub-packages are not meant to be used directly. Therefore, we recommend not installing them directly.
Resolution
- Ensure the versions of the main package and the sub-packages are the same.
Copy the code to the clipboard
- Try removing the lockfile and node_modules folder, then reinstall the dependencies.
Sometimes, the package manager retains an old version of the sub-packages in the lockfile cache. To resolve this, you can try removing the lockfile and node_modules folder, then reinstall the dependencies.
Copy the code to the clipboard
- Check global installation
We recommend installing intlayer or intlayer-cli globally to access the CLI commands. If the global version differs from the local version, the package manager may use the incorrect version.
Check if a package is installed globally
Copy the code to the clipboard
Copy the code to the clipboard
Copy the code to the clipboard
Copy the code to the clipboard
Fix potential global dependency conflicts
Copy the code to the clipboard
Copy the code to the clipboard
Copy the code to the clipboard
- Try cleaning the cache
In some environments such as Docker, GitHub Actions, or web hosting platforms like Vercel, a cache may be present. You can try clearing the cache and retry the installation.
You can also try clearing the cache of your package manager with the following command:
Copy the code to the clipboard
Copy the code to the clipboard
Copy the code to the clipboard