Closed JohnMichaelangelo20 closed 4 months ago
Having this issue on Windows 10 as well.
The file does exist in C:\Users\user\AppData\Local\Temp\nx-native-file-cache-41edfcf\19.1.0-nx.win32-x64-msvc.node
but it seems like nx adds \\?\
in front of the path it's trying to load just like in the error above:
npm ERR! \\?\C:\Users\user\AppData\Local\Temp\nx-native-file-cache-41edfcf\19.1.0-nx.win32-x64-msvc.node
Setting NX_NATIVE_FILE_CACHE_DIRECTORY = "/tmp/mycache"
in my env variable will result in the same issue:
npm ERR! \\?\C:\tmp\mycache\AppData\Local\Temp\nx-native-file-cache-41edfcf\19.1.0-nx.win32-x64-msvc.node
I tried to downgrade the version of nx to 18.3.4
as well but the same issue occurs so I'm assuming it's not new.
Hey! For now it should be possible to set the NX_NATIVE_FILE_CACHE_DIRECTORY
variable to something else.
Can you check whether it works for you if you specify an absolute path there?
I don't think the \\?
is the issue, it looks like that's just how windows specifies potentially very long paths.
The module loading error is a bit of a misdirect I think as it shadows the true, underlying error. In this case this is ERR_DLOPEN_FAILED
which I've never heard of before. @Wurielle do you get the same stack trace with ERR_DLOPEN_FAILED
? Does the error code change if you specify NX_NATIVE_FILE_CACHE_DIRECTORY
? Since it's in 18.3.4, it sounds like it might be a different issue.
@JohnMichaelangelo20 can you make sure that when you try to npm i nx -g
, there are no other processes that might somehow use nx (vscode, intellij, daemon,...) running at the same time? It would give me more information. Thank you :)
Hey! For now it should be possible to set the
NX_NATIVE_FILE_CACHE_DIRECTORY
variable to something else. Can you check whether it works for you if you specify an absolute path there? I don't think the\\?
is the issue, it looks like that's just how windows specifies potentially very long paths.The module loading error is a bit of a misdirect I think as it shadows the true, underlying error. In this case this is
ERR_DLOPEN_FAILED
which I've never heard of before. @Wurielle do you get the same stack trace withERR_DLOPEN_FAILED
? Does the error code change if you specifyNX_NATIVE_FILE_CACHE_DIRECTORY
? Since it's in 18.3.4, it sounds like it might be a different issue.@JohnMichaelangelo20 can you make sure that when you try to
npm i nx -g
, there are no other processes that might somehow use nx (vscode, intellij, daemon,...) running at the same time? It would give me more information. Thank you :)
I did run the command without anything being opened. I also just reformat my whole device and the very first I did was to install node and install nx and the error occurs from the beggining even if it's a fresh device.
is there anything else that might be special about your machine? multiple users, permissions? Have you tried setting the 'NX_NATIVE_FILE_CACHE_DIRECTORY' environment variable to another place that you surely have access to? I've tried reproducing and on my windows machine it installs just fine... So I need some more information. Can you trace it to an exact version where it worked before? Maybe you can record a video of it happening?
Hi @MaxKless ๐๐ผ No, there is nothing special on my machine.
But npm i nx -g was working when it was on windows 11 and had to downgrade it to windows 10 but since then I got this error (here is what I download https://www.microsoft.com/en-us/software-download/windows10)
This is what I followed https://www.youtube.com/watch?v=hnBO1aTgrVs
and I tried to install & uninstall node js got this pop up with different .msi each time I'm installing node that needed to be yes
Do you want to allow this app to make changes to your device?
8e80.msi` / 968e.msi / 9e9c.msi / 27e0f.msi
Multiple Users
User Permission
What is installed in my device (nvm is only here because I tried to install nx and have removed node js but same error; I tried install nx via node downloaded from nvm and node is uninstall and vice versa, same error ๐ )
Windows C: Security settings
Do I need something to be enabled/checked here?
@JohnMichaelangelo20 @Wurielle can you try setting the NX_NATIVE_FILE_CACHE_DIRECTORY
env variable to another place that you have access to and check that it works with that workaround?
@MaxKless I added it to a new folder
I checked if I have access to that file (I have) and installed the nx again and got this (kindly see screenshot)
but it is here
huh, interesting... does the same happen if you have a folder name without any spaces?
yes, the first one I tried was without the space. Same error given.
sorry I'm poking a little bit in the dark here since I can't reproduce it myself. Have you tried on node 18 instead of 20?
yes, same error. ๐
For the record, i had the crash on Linux, probably because i was running docker with --tmpfs /tmp
; defining NX_NATIVE_FILE_CACHE_DIRECTORY to another location fixed it.
rm -rf /private/var/folders/rw/z_n8j7kd5_18t2bdrx7s65vw0000gq/T/nx-native-file-cache-84f6168
Need to install Microsoft Visual C++ 2015 Redistributable package
see more here https://github.com/lerna/lerna/issues/3612#issuecomment-1499259377
Hello everyone, I didn't keep track of which recent updates in nx did solve this issue but I tried it now and it is now working. ๐
Hello @JohnMichaelangelo20 i am have same issue as you, i also tried to follow the two possible solution you used to get yours to work. i would like to know which of them seems like the right one to do.
@Bruno-Devs Hi, may I see your control panel?
Have you checked this one out? https://github.com/lerna/lerna/issues/3612#issuecomment-1499259377
https://www.microsoft.com/en-us/download/details.aspx?id=48145
@Bruno-Devs Hi, may I see your control panel?
Have you checked this one out? lerna/lerna#3612 (comment)
https://www.microsoft.com/en-us/download/details.aspx?id=48145
i have tried the two of them
Control Panel\Programs\Programs and Features
sorry, this path rather @Bruno-Devs .
this is it
@Bruno-Devs I only have this two.
did you restart your system after you uninstalled it
@Bruno-Devs yes, better clean everything and restart before installing it.
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.
Current Behavior
I'm using windows 10
I tried installing other packages/library globally it works (I know that this isn't about permission)... nx is the only thing that is not installing
using nvm to download node
node version: 20.13.1 npm version: 10.5.2
i even tried to rebuild the npm to be sure but yet it's still have a problem
Expected Behavior
I wanted this one to be installed
GitHub Repo
No response
Steps to Reproduce
Nx Report
Failure Logs
No response
Package Manager Version
10.5.2
Operating System
Additional Information
No response