Troubleshoot Nx Installations
Here are some common scenarios we came across while trying to run Nx on CIs
Native Modules
With more recent versions of Nx, we publish native binaries that should be automatically downloaded and installed when Nx is used.
If you see a message saying that your platform is not supported (or that Nx cannot find a @nx/nx-platform
module for versions of Nx between 15.8 and 16.4), there are a few reasons why this could potentially happen:
- Running your install command with
--no-optional
(or the relative flag in yarn, pnpm, etc) - Running your install with
--dev
for pnpm. - The package-lock.json file was not correctly updated by npm, and missed optional dependencies used by Nx. You can read more about this issue on the npm repository.
- Your platform is not supported
When updating Nx that is already on 15.8, the package-lock.json should continue to be updated properly with all the proper optional dependencies.
How to fix
- If you are running your install command with
--no-optional
, try again without the flag. - Delete your node_modules and
package-lock.json
and re-runnpm i
. This should have thepackage-lock.json
file updated properly.
Supported native module platforms
We publish modules for the following platforms:
- macOS 11+ (arm64, x64)
- Windows (arm64, x64)
- We use the
msvc
target, so as long as Microsoft supports your Windows version, it should work on it
- We use the
- Linux (arm64, x64)
- We use
gnu
angmusl
targets, which are used by the most popular Linux distributions
- We use
- FreeBSD (x64)
If you're running a machine that isn't part of the list above, then Nx does not support it at this time. Please open an issue on Github if you feel Nx should support that platform and we will assess what can be done, please make sure to include your platform and architecture in the issue.