lerna: Unable to build on windows due to module not found @nrwl\nx-win32-x64-msvc\nx.win32-x64-msvc.node
This is an issue affecting Windows machines:
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
{
"$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® Core™ 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
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 19 (3 by maintainers)
@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 https://github.com/parcel-bundler/parcel/issues/7104#issuecomment-967260755 and it helped
These steps help me:
Success!
Thank you so much @jazzominy that has fixed my problem 😃
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
This error occurs when you install the 32-bit version of Node on a 64-bit Windows system.
https://nodejs.org/en/download/current
The fix for this issue is to install the Microsoft Visual C++ 2015 Redistributable package on any affected windows machine.