Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This platform (win32-x64) is currently not supported by Nx. after 16.4.0 update #17767

Closed
1 of 4 tasks
SteveW94 opened this issue Jun 24, 2023 · 61 comments · Fixed by GlobalFishingWatch/frontend#2131
Closed
1 of 4 tasks
Assignees
Labels

Comments

@SteveW94
Copy link

Current Behavior

After updating from 16.3.x to 16.4 today, our CI-Pipeline nx-Tasks stopped working with the following message:

" This platform (win32-x64) is currently not supported by Nx."

  • The exact same tasks worked perfectly fine before
  • yarn.lock has been freshly generated
  • Latest node version is used
  • The Pipeline runs on an AzureDevops Windows 10 64bit Agent

Expected Behavior

No error messages when using nx-Tasks on Windows 10 CI agent

GitHub Repo

No response

Steps to Reproduce

  1. Use nx 16.4 Task in CI pipeline

Nx Report

-

Failure Logs

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

@canibanoglu
Copy link

canibanoglu commented Jun 26, 2023

I'm having the same issue but on GitHub CI with ubuntu-latest (v22.04.2). Works on my local machine (Mac arm64) and this started happening after the 16.4 update for me too.

Exact error message: This platform (linux-x64) is currently not supported by Nx.

@leosvelperez leosvelperez added the scope: core core nx functionality label Jun 26, 2023
@salihsagdilek
Copy link

also same issue digitalocean app platform.

This platform (linux-x64) is currently not supported by Nx.

@Cammisuli Cammisuli self-assigned this Jun 26, 2023
@Cammisuli
Copy link
Member

Cammisuli commented Jun 26, 2023

Oh no! That's not right, linux and Windows are definitely supported. This usually happens because the node_modules directory was installed with the --no-optional flag (or other scenarios).

You can read more about it here:
https://nx.dev/recipes/ci/troubleshoot-nx-install-issues#troubleshoot-nx-installations

If things still don't work after following the document, let me know.

@SteveW94
Copy link
Author

SteveW94 commented Jun 27, 2023

@Cammisuli

I read about this thorough :)

We make sure that in our CI Pipeline we do always create the node_modules from scratch and Also I re-assured multiple times that we nowhere use the no-optional flag.

Also as I mentioned the same setup works perfectly fine with NX 16.3.2 and stopped working all of a sudden after udpating to 16.4.

@canibanoglu
Copy link

We're not using the --no-optional flag at all in the project, our CI does a clean install every time and this started happening after the update to 16.4. We had to revert to the previous version at which point everything started running as they should

@SteveW94
Copy link
Author

We're not using the --no-optional flag at all in the project, our CI does a clean install every time and this started happening after the update to 16.4. We had to revert to the previous version at which point everything started running as they should

Exactly same behaviour here :)

@Cammisuli
Copy link
Member

Do you all have a reproduction somewhere I can take a look at?

Particularly the package.json and CI commands that are used?

@Cammisuli
Copy link
Member

Also, if you take a look inside the node_modules/@nx directory, do you see any packages that are along the lines of nx-platform-arch (eg. nx-win32-x64-msvc)

@SteveW94
Copy link
Author

  • We run a target with the "nx:run-commands", executor which fails

  • The following dependencies we are using and were beforehand 16.3 and got updated to 16.4:

  • "@nx/eslint-plugin": "16.4.0",
    "@nx/js": "16.4.0",
    "@nx/linter": "16.4.0",
    "@nx/webpack": "16.4.0",
    "@nx/workspace": "16.4.0",
    "nx": "16.4.0",
    "@nx/angular": "16.4.0",

  • In the node_modules @nx directory we have the following folder:
    nx-win32-x64-msvc

@Cammisuli
Copy link
Member

Oh now that's suspicious. The native binary package is there.

We use a Windows agent when we do publishing, so it definitely works on Windows.

I'll see what I can find on a local Windows machine then.

@SteveW94
Copy link
Author

Also I just started a run on all our available agents => It seems that not every run is affected...just like 80% or sth...But I am not able to identify why this is the case as ALL machines are the same image

@Cammisuli
Copy link
Member

Just for my curiousity @SteveW94, are you running Windows 10 on Azure with On-Premise hosting?

@SteveW94
Copy link
Author

Just for my curiousity @SteveW94, are you running Windows 10 on Azure with On-Premise hosting?

It's definatly Windows 10.
And yes I am not entirely sure but it could be on-prem hosting AFAIK

@Cammisuli
Copy link
Member

What's the install command being used @SteveW94 ?

@SteveW94
Copy link
Author

What's the install command being used @SteveW94 ?

This would be:

"yarn install --force --pure-lockfile"

@Cammisuli
Copy link
Member

Cammisuli commented Jun 27, 2023

Doesnt seem like I can reproduce the Windows issue. Both locally and on Azure are working for me.
Here's the azure run: https://cammisuli.visualstudio.com/Nx%20Repros/_build/results?buildId=24&view=logs&j=12f1170f-54f2-53f3-20dd-22fc7dff55f9&t=bd05475d-acb5-5619-3ccb-c46842dbc997&l=28

and the repo if you want to change some things to break it:
https://github.com/cammisuli/nx-repros

@Cammisuli
Copy link
Member

@SteveW94 what version of yarn is being used?

@SteveW94
Copy link
Author

@SteveW94 what version of yarn is being used?

v1.22.19 Same as yours 🙈

@Cammisuli
Copy link
Member

@SteveW94 can you confirm that all your Windows 10 agents are running with the latest Windows updates? Specifically can you check to see if the msvc redistribution is correct for all of them?

https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170

This it the only thing I can think of now, especially because you say that it works on some of your agents.

@creadicted
Copy link

creadicted commented Jun 28, 2023

I'm having the same issue but on GitHub CI with ubuntu-latest (v22.04.2). Works on my local machine (Mac arm64) and this started happening after the 16.4 update for me too.

Exact error message: This platform (linux-x64) is currently not supported by Nx.

Same. This platform (linux-x64) is currently not supported by Nx. Updated nx with the additional dependencies from the migration.

@FrozenPandaz
Copy link
Collaborator

FrozenPandaz commented Jun 28, 2023

@creadicted What is the command you used to install your npm dependencies? And can you check if node_modules/@nx contains nx-linux-x64-gnu on the Github Actions agent?

@SteveW94
Copy link
Author

@SteveW94 can you confirm that all your Windows 10 agents are running with the latest Windows updates? Specifically can you check to see if the msvc redistribution is correct for all of them?

https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170

This it the only thing I can think of now, especially because you say that it works on some of your agents.

I will try to verify that and ask the person responsible for the agents image.
Can you say how I check the correct msvc redistribution? For which kind of redistributable am I looking for and which version is the latest?

Also what grinds my gears: We did not change anything and with 16.3.2 everything works fine on all agents and 100% of the run, and it starts breaking with 16.4. So at least sth seems to have changed there regarding this?

@martinkamara
Copy link

I also got this problem upgrading to latest nx. When I run npm ci on another OS different from where the package-lock.json file was created nx complains about This platform (linux-x64) is currently not supported by Nx.

If i instead run rm package-lock.json && npm install it works. Also nothing has changed in my environments like you @SteveW94

@creadicted
Copy link

creadicted commented Jun 28, 2023

@FrozenPandaz I use the default script mentioned here
https://github.com/nrwl/nx/blob/master/docs/shared/monorepo-ci-github-actions.md

jobs:
  main:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - uses: nrwl/nx-set-shas@v3
      - run: npm ci
      - run: npx nx format:check
        continue-on-error: true
      - run: npx nx affected -t lint --parallel=3
      - run: npx nx affected -t test --parallel=3 --configuration=ci
      - run: npx nx affected -t build --parallel=3

I also got this problem upgrading to latest nx. When I run npm ci on another OS different from where the package-lock.json file was created nx complains about This platform (linux-x64) is currently not supported by Nx.

If i instead run rm package-lock.json && npm install it works. Also nothing has changed in my environments like you @SteveW94

this seems to work

    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - uses: nrwl/nx-set-shas@v3
      - run: rm package-lock.json && npm install
      - run: npx nx format:check

Which odly leads to a library linting fail which can not be reproduced. Not shure if related.

@Cammisuli
Copy link
Member

Cammisuli commented Jun 29, 2023

@creadicted & @martinkamara you folks seem to be hitting the npm bug linked here: npm/cli#4828

@SteveW94 We're trying to improve the performance of Nx, and we're compiling rust to be used in Node. With the latest changes, we removed a fallback to Node because we have plans to write more performance oriented code in rust.

In 16.3, we did the same check as we're doing now, but you didnt see the errors before because you were using the Node version.

Now to check what version of msvc is installed, the only thing I saw was to use "Add & Remove programs" and check the version there. I'm not sure of a way to check it in cmd. I'll edit this if I find something.

Here's what I have on Windows 11
image

@SteveW94
Copy link
Author

Thanks for the detailed Information @Cammisuli
I will contact our team which maintains the agents to assure that everything is up to date, retest and then reach back to you 👍

@Cammisuli
Copy link
Member

I am having trouble building my application in my CI (Render). I am not having this error using command line locally and can build properly.

I am getting this error:


NX   Missing Platform Dependency



The Nx CLI could not find or load the native binary for your supported platform (linux-x64).

This likely means that optional dependencies were not installed correctly, or your system is missing some system dependencies.

I have went through the steps outlined here: https://nx.dev/recipes/ci/troubleshoot-nx-install-issues. I also have removed my node_modules folders and package-lock.json and reran npm install.

@jennifertrin do you have a link to your ci, or able to reproduce it somewhere where I can take a look?

Any info is good.

@k3nsei
Copy link

k3nsei commented Jul 11, 2023

To make it work on GitHub Actions I needed to add code below to package.json I used latest NX version which is v16.5.1 and then run npm install --include=optional

"optionalDependencies": {
  "@nx/nx-darwin-arm64": "16.5.1",
  "@nx/nx-darwin-x64": "16.5.1",
  "@nx/nx-linux-x64-gnu": "16.5.1",
  "@nx/nx-win32-x64-msvc": "16.5.1"
}

@dbsmck
Copy link

dbsmck commented Jul 17, 2023

To make it work on GitHub Actions I needed to add code below to package.json I used latest NX version which is v16.5.1 and then run npm install --include=optional

"optionalDependencies": {
  "@nx/nx-darwin-arm64": "16.5.1",
  "@nx/nx-darwin-x64": "16.5.1",
  "@nx/nx-linux-x64-gnu": "16.5.1",
  "@nx/nx-win32-x64-msvc": "16.5.1"
}

This really helped! Thanks

@gabrielemilan
Copy link

I had same issue, resolved upgrading to 16.5.3

@Exoow
Copy link

Exoow commented Jul 27, 2023

@Cammisuli

We upgraded to 16.5.5 and still face the issue when trying to serve our app locally against the official Microsoft Playwright Docker image. The error remains when we explicitly add the linux dependencies.

image

@Cammisuli
Copy link
Member

@Exoow did you force install all the packages? Can you confirm that node_modules has all the proper deps in the @nx folder?

@Exoow
Copy link

Exoow commented Aug 2, 2023

@Cammisuli ah, using --force revealed the error that the linux package is not compatible with my Windows. So I need to install the dependency inside the container, then it works.

@Cammisuli
Copy link
Member

Cammisuli commented Aug 2, 2023

I think most of the issues here were solved, nx.dev/recipes/ci/troubleshoot-nx-install-issues will contain information on how to troubleshoot.

Also, if there are folks who are building on a host machine and using a docker container; make sure that the docker container does its own npm install, or --force install the dependencies on the host machine to get all binaries.

If the above solutions do not work for you, please open a new issue.

arma73 pushed a commit to arma73/arma73.github.io that referenced this issue Aug 21, 2023
@cvandradg
Copy link

cvandradg commented Aug 23, 2023

Hi @Cammisuli

Yeah we're using yarn v3, so our .yarnrc.yml needs to have the supportedArchitectures field configured.

Thanks for the pointers. Now it works as expected 👍

@rmachado-studocu Can you share how do u have the yarnrc.yml configured please?

Mine looks like this, not sure if It's right

nodeLinker: node-modules

npmRegistries:
  //npm.fontawesome.com/:
    npmAuthToken: XXXXXX-XXXX-XXXX-XXXX-XXXXXXX

npmScopes:
  fortawesome:
    npmRegistryServer: 'https://npm.fontawesome.com/'

yarnPath: .yarn/releases/yarn-4.0.0-rc.43.cjs

supportedArchitectures:
  os:
    - 'current'
    - 'linux'
  cpu:
    - 'current'
    - 'x64'

@cvandradg
Copy link

nvm, I fixed it with:

  "optionalDependencies": {
    "@nx/nx-darwin-arm64": "16.5.1",
    "@nx/nx-darwin-x64": "16.5.1",
    "@nx/nx-linux-x64-gnu": "16.5.1",
    "@nx/nx-linux-x64-musl": "16.5.1",
    "@nx/nx-win32-x64-msvc": "16.5.1"
  },

And removing the supportedArchitectures from the yarnrc.yml.

I was having issues with a FirebaseExtended/action-hosting-deploy@v0 it end up been a yarn build been called by a predeploy script

The The Nx CLI could not find or load the native binary for your supported platform (linux-x64). seems to be fully solved

@Sebastian-G
Copy link

Sebastian-G commented Sep 11, 2023

The Issue still exists for WebContainers (on MacOS ARM as Host).

The report was created on my Stackblitz WebContainer.

nx report

 >  NX   Nx Daemon was not able to compute the project graph.

   Log file with the error: /home/projects/zrgmcf/node_modules/.cache/nx/d/daemon-error.log
   Please file an issue at https://github.com/nrwl/nx
   Nx Daemon is going to be disabled until you run "nx reset".


 >  NX   Report complete - copy this into the issue template

   Node   : 16.20.0
   OS     : linux-x64
   npm    : 9.4.2
   
   nx                 : 16.8.1
   @nx/js             : 16.8.1
   @nx/jest           : 16.8.1
   @nx/linter         : 16.8.1
   @nx/workspace      : 16.8.1
   @nx/angular        : 16.8.1
   @nx/cypress        : 16.8.1
   @nx/devkit         : 16.8.1
   @nx/eslint-plugin  : 16.8.1
   @nrwl/tao          : 16.8.1
   @nx/webpack        : 16.8.1
   typescript         : 5.1.6
   ---------------------------------------
   Community plugins:
   ng-mocks : 14.11.0

Installed by npm install --include=optional

with optional dependencies:

  "optionalDependencies": {
    "@nx/nx-darwin-arm64": "16.8.1",
    "@nx/nx-darwin-x64": "16.8.1",
    "@nx/nx-linux-x64-gnu": "16.8.1",
    "@nx/nx-linux-x64-musl": "16.8.1",
    "@nx/nx-win32-x64-msvc": "16.8.1"
  }

but still unable to serve the app.

npm start

>nx-stackblitz-tailwind@0.0.0 start
> nx serve


 >  NX   Missing Platform Dependency

   The Nx CLI could not find or load the native binary for your supported platform (linux-x64).
   This likely means that optional dependencies were not installed correctly, or your system is missing some system dependencies.
   For more information please see https://nx.dev/recipes/troubleshooting/troubleshoot-nx-install-issues

@jmeinlschmidt
Copy link

same here, version 16.8.1

@Bielik20
Copy link
Contributor

Had the same issue. I have like 4 repos with Nx (one at work) and one of them had problem after update to 16.8.1

What helped was:

  1. removing package-lock.json and node_modules.
  2. installing stuff with npm install --include=optional + npm install
  3. after that I also run npm dedupe because some deps where not deduplicated

@0m4r
Copy link

0m4r commented Sep 26, 2023

I am experiencing the same issue running some code using Lerna with version > 7.1.5 and running npm ci on an Azure Pipeline (linux, cloud hosted).
(I hope this is not OT, but opening the same bug in the Lerna repo would be not very helpful I guess.)

@ziacik
Copy link
Contributor

ziacik commented Sep 27, 2023

We're experiencing this too. We, however, run on multiple platforms. npm i works on linux (that's where i have updated package-lock lastly), but on windows it shows the error. Is it possible that it only works on linux if package-lock is updated on linux because only the linux optional dependency is added to package-lock?

@shubhamkuswah
Copy link

I had similar issue in ubuntu 22.x with docker based project.I updated my nx version from 16.8.1 to 16.9.1 and that fixed my issue.

@eestein
Copy link

eestein commented Oct 28, 2023

I am experiencing the same issue running some code using Lerna with version > 7.1.5 and running npm ci on an Azure Pipeline (linux, cloud hosted). (I hope this is not OT, but opening the same bug in the Lerna repo would be not very helpful I guess.)

My exact problem. Any fixes so far? Got a broken pipeline here.

@dongeerts
Copy link

dongeerts commented Nov 21, 2023

I had similar issue in ubuntu 22.x with docker based project.I updated my nx version from 16.8.1 to 16.9.1 and that fixed my issue.

I've upgraded nx from version 16.9.0 to 16.10.0 resolving the issue in the Azure pipeline on Ubuntu 22.x as well.

@alex-okrushko
Copy link

The Issue still exists for WebContainers (on MacOS ARM as Host).

The report was created on my Stackblitz WebContainer.

nx report

 >  NX   Nx Daemon was not able to compute the project graph.

   Log file with the error: /home/projects/zrgmcf/node_modules/.cache/nx/d/daemon-error.log
   Please file an issue at https://github.com/nrwl/nx
   Nx Daemon is going to be disabled until you run "nx reset".


 >  NX   Report complete - copy this into the issue template

   Node   : 16.20.0
   OS     : linux-x64
   npm    : 9.4.2
   
   nx                 : 16.8.1
   @nx/js             : 16.8.1
   @nx/jest           : 16.8.1
   @nx/linter         : 16.8.1
   @nx/workspace      : 16.8.1
   @nx/angular        : 16.8.1
   @nx/cypress        : 16.8.1
   @nx/devkit         : 16.8.1
   @nx/eslint-plugin  : 16.8.1
   @nrwl/tao          : 16.8.1
   @nx/webpack        : 16.8.1
   typescript         : 5.1.6
   ---------------------------------------
   Community plugins:
   ng-mocks : 14.11.0

Installed by npm install --include=optional

with optional dependencies:

  "optionalDependencies": {
    "@nx/nx-darwin-arm64": "16.8.1",
    "@nx/nx-darwin-x64": "16.8.1",
    "@nx/nx-linux-x64-gnu": "16.8.1",
    "@nx/nx-linux-x64-musl": "16.8.1",
    "@nx/nx-win32-x64-msvc": "16.8.1"
  }

but still unable to serve the app.

npm start

>nx-stackblitz-tailwind@0.0.0 start
> nx serve


 >  NX   Missing Platform Dependency

   The Nx CLI could not find or load the native binary for your supported platform (linux-x64).
   This likely means that optional dependencies were not installed correctly, or your system is missing some system dependencies.
   For more information please see https://nx.dev/recipes/troubleshooting/troubleshoot-nx-install-issues

I cannot even get that far

 nx report
Error: Cannot load native addon because loading addons is disabled: /home/projects/rsug1b-qjfxiq/node_modules/nx/node_modules/@nx/nx-linux-x64-musl/nx.linux-x64-musl.node
    at process.dlopen (https://rsug1bqjfxiq-k5ff.w-credentialless.staticblitz.com/blitz.95086023.js:352:57629)
    at Module._extensions..node (https://rsug1bqjfxiq-k5ff.w-credentialless.staticblitz.com/blitz.95086023.js:55:15934)
    at Module.load (https://rsug1bqjfxiq-k5ff.w-credentialless.staticblitz.com/blitz.95086023.js:55:13457)
    at Module._load (https://rsug1bqjfxiq-k5ff.w-credentialless.staticblitz.com/blitz.95086023.js:55:10535)
    at Module.require (https://rsug1bqjfxiq-k5ff.w-credentialless.staticblitz.com/blitz.95086023.js:55:13775)
    at i (https://rsug1bqjfxiq-k5ff.w-credentialless.staticblitz.com/blitz.95086023.js:98:2198)
    at _0x521062 (https://rsug1bqjfxiq-k5ff.w-credentialless.staticblitz.com/blitz.95086023.js:352:206666)
    at Object.eval (file:///home/projects/rsug1b-qjfxiq/node_modules/nx/src/native/index.js:171:31)
    at Object.function (https://rsug1bqjfxiq-k5ff.w-credentialless.staticblitz.com/blitz.95086023.js:352:207446)
    at Module._compile (https://rsug1bqjfxiq-k5ff.w-credentialless.staticblitz.com/blitz.95086023.js:55:14871) {
  code: 'ERR_DLOPEN_DISABLED'
}

This is another attempt to run latest nx in Stackblitz.

https://developer.stackblitz.com/platform/webcontainers/troubleshooting-webcontainers#cannot-load-native-addon

Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.