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

Unable to build on windows due to module not found @nrwl\nx-win32-x64-msvc\nx.win32-x64-msvc.node #3612

Closed
lnmp4000 opened this issue Mar 24, 2023 · 19 comments

Comments

@lnmp4000
Copy link

This is an issue affecting Windows machines:

image

Current Behavior

I can successfully build on Linux, but when my colleagues attempt the same build on windows, they encounter the above error.
Looking in the node_modules folder I can see the nx.win32-x64-msvc.node file in the expected path.

Expected Behavior

Builds should work on Windows as well as Linux machines.

Steps to Reproduce

Using a Windows machine and
Node v18.13.0
npm v8.19.3

Follow steps:

git clone https://github.com/lerna/getting-started-example.git
cd getting-started-example
git checkout prelerna
npm install

Within the above folder

npx lerna@latest init
npm install
npx lerna@latest run build

The following message is shown on Windows machines
image

{
  "$schema": "node_modules/lerna/schemas/lerna-schema.json",
  "useWorkspaces": true,
  "version": "0.0.0"
}

Environment

lerna notice cli v6.6.0

Environment info:

System:
OS: Windows 10 10.0.17763
CPU: (2) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
Binaries:
Node: 18.13.0 - C:\Program Files\nodejs\node.EXE
npm: 8.19.3 - C:\Program Files\nodejs\npm.CMD
Utilities:
Git: 2.39.0. - /mingw64/bin/git
npmPackages:
lerna: ^6.6.0 => 6.6.0

@JamesHenry
Copy link
Member

Hi @lnmp4000 one of the members of our team with a windows machine has been unable to reproduce this issue.

Sometimes we have seen issues with lock files not being quite right, so that would be your next step in troubleshooting.

There should be entries like these (or similar) in your lock file:

// more lockfile contents
    "node_modules/@nrwl/nx-linux-x64-musl": {
      "version": "15.8.9",
      "resolved": "https://registry.npmjs.org/@nrwl/nx-linux-x64-musl/-/nx-linux-x64-musl-15.8.9.tgz",
      "integrity": "sha512-0RSEqFdwJmJZDhuj8yOKqxIr7olY4Xm+0hMNjz+20BVi2g37Oq138VC0iikzwaQVDP5Ude3cVaoRw4VBYlPfNw==",
      "cpu": [
        "x64"
      ],
      "dev": true,
      "optional": true,
      "os": [
        "linux"
      ],
      "engines": {
        "node": ">= 10"
      }
    },
    "node_modules/@nrwl/nx-win32-arm64-msvc": {
      "version": "15.8.9",
      "resolved": "https://registry.npmjs.org/@nrwl/nx-win32-arm64-msvc/-/nx-win32-arm64-msvc-15.8.9.tgz",
      "integrity": "sha512-GRs0cF3hyT7wdwlTwP4L5HG9LuHxt+I0/lTYzzUsUSs2WIvn6qycoKZv1qc/aSdZv+LgdKiPE5U7zHEVc6zpaA==",
      "cpu": [
        "arm64"
      ],
      "dev": true,
      "optional": true,
      "os": [
        "win32"
      ],
      "engines": {
        "node": ">= 10"
      }
    },
    "node_modules/@nrwl/nx-win32-x64-msvc": {
      "version": "15.8.9",
      "resolved": "https://registry.npmjs.org/@nrwl/nx-win32-x64-msvc/-/nx-win32-x64-msvc-15.8.9.tgz",
      "integrity": "sha512-u0L3T1ZMr4j1YM+6DdxnaJUl+VSkbSu+2vcLvLyo+c+Ekhr/JDirXPfyCdoM6c/DN+1NK1Km29soawX9Oyb2MA==",
      "cpu": [
        "x64"
      ],
      "dev": true,
      "optional": true,
      "os": [
        "win32"
      ],
      "engines": {
        "node": ">= 10"
      }
    },
// more lockfile contents

If they are not there, do not add them manually. Instead perhaps look at regenerating your lockfile by deleting it and doing a fresh install.

You should then see a relevant native entry in your node_modules/@nrwl/ directory

Hope that helps!

@JamesHenry JamesHenry closed this as not planned Won't fix, can't repro, duplicate, stale Mar 29, 2023
@lnmp4000
Copy link
Author

I do have those entries in the package-lock.json

 "node_modules/@nrwl/nx-linux-x64-musl": {
            "version": "15.8.9",
            "resolved": "https://registry.olmeservices.co.uk/repository/npm-all/@nrwl/nx-linux-x64-musl/-/nx-linux-x64-musl-15.8.9.tgz",
            "integrity": "sha512-0RSEqFdwJmJZDhuj8yOKqxIr7olY4Xm+0hMNjz+20BVi2g37Oq138VC0iikzwaQVDP5Ude3cVaoRw4VBYlPfNw==",
            "cpu": [
                "x64"
            ],
            "dev": true,
            "optional": true,
            "os": [
                "linux"
            ],
            "engines": {
                "node": ">= 10"
            }
        },
        "node_modules/@nrwl/nx-win32-arm64-msvc": {
            "version": "15.8.9",
            "resolved": "https://registry.olmeservices.co.uk/repository/npm-all/@nrwl/nx-win32-arm64-msvc/-/nx-win32-arm64-msvc-15.8.9.tgz",
            "integrity": "sha512-GRs0cF3hyT7wdwlTwP4L5HG9LuHxt+I0/lTYzzUsUSs2WIvn6qycoKZv1qc/aSdZv+LgdKiPE5U7zHEVc6zpaA==",
            "cpu": [
                "arm64"
            ],
            "dev": true,
            "optional": true,
            "os": [
                "win32"
            ],
            "engines": {
                "node": ">= 10"
            }
        },
        "node_modules/@nrwl/nx-win32-x64-msvc": {
            "version": "15.8.9",
            "resolved": "https://registry.olmeservices.co.uk/repository/npm-all/@nrwl/nx-win32-x64-msvc/-/nx-win32-x64-msvc-15.8.9.tgz",
            "integrity": "sha512-u0L3T1ZMr4j1YM+6DdxnaJUl+VSkbSu+2vcLvLyo+c+Ekhr/JDirXPfyCdoM6c/DN+1NK1Km29soawX9Oyb2MA==",
            "cpu": [
                "x64"
            ],
            "dev": true,
            "optional": true,
            "os": [
                "win32"
            ],
            "engines": {
                "node": ">= 10"
            }
        }

I have also tried to re-generate the package-lock on the windows machine, but the error still exists.

@JamesHenry JamesHenry reopened this Mar 29, 2023
@JamesHenry
Copy link
Member

Hmm I wonder if your custom registry is playing a role here...

https://registry.olmeservices.co.uk

Please could you delete the lockfile again and try npm install --registry=https://registry.npmjs.org (or remove however you have configured the custom registry before running npm install

@jazzominy
Copy link

jazzominy commented Apr 4, 2023

@lnmp4000 can you try installing Microsoft Visual C++ 2015 Redistributable (x64)

You can get the download here -> https://aka.ms/vs/17/release/vc_redist.x64.exe

Accessing native windows code (nx-win32-arm64-msvc package) requires above redistributable. Hope this helps. I faced the similar error and found that i didnt have the redistributable installed. Installing it fixed the error

I came across this parcel-bundler/parcel#7104 (comment) and it helped

@lnmp4000
Copy link
Author

lnmp4000 commented Apr 4, 2023

@lnmp4000 can you try installing Microsoft Visual C++ 2015 Redistributable (x64)

You can get the download here -> https://aka.ms/vs/17/release/vc_redist.x64.exe

Accessing native windows code (nx-win32-arm64-msvc package) requires above redistributable. Hope this helps. I face the similar error and found that i didnt have the redistributable installed. Installing it fixed the error

I came across this parcel-bundler/parcel#7104 (comment) and it helped

Success!

Thank you so much @jazzominy that has fixed my problem :-)

@codarose
Copy link

codarose commented Apr 4, 2023

@jazzominy We are having a really similar issue with a windows user, except it says we are missing '@nrwc/nx-win32-ia32-msvc'. Any ideas how to fix that?

@lnmp4000
Copy link
Author

lnmp4000 commented Apr 6, 2023

The fix for this issue is to install the Microsoft Visual C++ 2015 Redistributable package on any affected windows machine.

@lnmp4000 lnmp4000 closed this as completed Apr 6, 2023
@jazzominy
Copy link

jazzominy commented Apr 7, 2023

@jazzominy We are having a really similar issue with a windows user, except it says we are missing '@nrwc/nx-win32-ia32-msvc'. Any ideas how to fix that?

@codarose Check the node_modules/@nrwl/nx-win32-msvc folder. If the package is there and you still have your error, then install the required ms visual redistributable as suggested in me earlier comment.

@kujtimprenkuSQA
Copy link

kujtimprenkuSQA commented May 7, 2023

For anyone who has Microsoft Visual C++ 2015 Redistributable installed on Windows and still faces this issue these steps fixed it for me:

  • Removenode_modules
  • Run yarn cache clean
  • Run yarn install

@TrofimovMishka
Copy link

These steps help me:

  • Microsoft Visual C++ 2015 Redistributable;
  • Remove node_modules directory;
  • Remove package-lock.json file;
  • npm cache verify;
  • Restart the machine;
  • npm install;

@magdalsen
Copy link

@lnmp4000 can you try installing Microsoft Visual C++ 2015 Redistributable (x64)

You can get the download here -> https://aka.ms/vs/17/release/vc_redist.x64.exe

Accessing native windows code (nx-win32-arm64-msvc package) requires above redistributable. Hope this helps. I faced the similar error and found that i didnt have the redistributable installed. Installing it fixed the error

I came across this parcel-bundler/parcel#7104 (comment) and it helped

For me also helped! I installed Microsoft Visual C++ 2015 Redistributable (x64).
I had similar issue:

node:internal/modules/cjs/loader:1327
return process.dlopen(module, path.toNamespacedPath(filename));
^

Error: The specified module could not be found.
\?\C:\Users[user_folder]\Documents\epenses-app\node_modules@rollup\rollup-win32-x64-msvc\rollup.win32-x64-msvc.node

@jamessv
Copy link

jamessv commented Nov 23, 2023

based on your architecture download and install Microsoft Visual C++ Redistributable latest supported downloads from here
https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170

@theashutoshshukl
Copy link

theashutoshshukl commented Nov 24, 2023

Finally, npm run dev issue solved by downloading this on my pc -
https://aka.ms/vs/17/release/vc_redist.x64.exe.

@abobakar-itbeam
Copy link

Finally, npm run dev issue solved by downloading this on my pc - https://aka.ms/vs/17/release/vc_redist.x64.exe.

@HasanurHasu
Copy link

Thank you

@Marlos11
Copy link

@lnmp4000 can you try installing Microsoft Visual C++ 2015 Redistributable (x64)

You can get the download here -> https://aka.ms/vs/17/release/vc_redist.x64.exe

Accessing native windows code (nx-win32-arm64-msvc package) requires above redistributable. Hope this helps. I faced the similar error and found that i didnt have the redistributable installed. Installing it fixed the error

I came across this parcel-bundler/parcel#7104 (comment) and it helped

Thank you so much for sharing—your solution really helped resolve my issue. Much appreciated!"

@fahslaj
Copy link
Contributor

fahslaj commented Jan 4, 2024

For others experiencing similar issues, see the troubleshooting nx installation docs

@alexxcamargo
Copy link

alexxcamargo commented Jan 5, 2024

This error occurs when you install the 32-bit version of Node on a 64-bit Windows system.

https://nodejs.org/en/download/current

image

@JawedCIA
Copy link

npm ERR! Error: The specified module could not be found.
npm ERR! \?\C:\azp\agent_work\1\s\Frontend\node_modules@nx\nx-win32-x64-msvc\nx.win32-x64-msvc.node

We had similar issue with Code compilation inside windows container. However after installing VC_redist.x64.exe in windows container solved the issue (as suggest above in few reply).

In DockerFile we added installation of VC_redist.x64.exe
RUN start-process -Filepath .\VC_redist.x64.exe -ArgumentList @('/install', '/quiet', '/norestart') -Wait; `
Remove-Item -Force VC_redist.x64.exe;

and at the end all SET with green build :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests