-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[BUG] Cannot work on FAT32 USB drive #4558
Comments
Hey, I have an external FAT32 HDD drive on my Ubuntu, and I have some similar problems. Npm install not work on FAT32 And before that I did set the globalconfig to "media/$MY_NAME/$HDD_Drive_name" , but i'm not sure if that is really neccessary, just document the stuff I did. |
I also faced the same issue on exFAT SSD. Is there any solution for this? |
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
I have started a react-native project. But instead of keeping files on hard drive I wanted to keep everything on a USB drive. I have formated it to FAT32. And so problem starts.
npm install
by default creates symlinks to binaries innode_modules/.bin/
, but FAT32 does not support symlinks. So runningnpm install
fails. Searching/googling around the internet the only thing I have found is to add--no-bin-links
argument. Unfortunatelly that does not solve anything. Yesnpm install
works, but everything after that fails. Runningnpx react-native
for example ends with error that command cannot be found. Which is to be expected - there is nonode_modules/.bin/
because of--no-bin-links
.I decided to look around the code of npm for solutions. I have found that there is a special case made for Windows to create shims (shell, powershell, cmd files) instead of symlinks (look
node_modules/bin-links/lib/link-bins.js line 4
. And also I found that I can cheat this isWindows check using env variable__TESTING_BIN_LINKS_PLATFORM__
(looknode_modules/bin-links/lib
line 1).And so for now I have added
export __TESTING_BIN_LINKS_PLATFORM__=win32
to my env and this way I have tricked npm into creating shell scripts instead of symlinks, and it works perfectly. I cannpm install
onto FAT32 USB drive. I can runnpx <commands>
no problem.But that is a hack/workaround, not a proper solution.
Expected Behavior
I would suggest to add new argument to
npm install
command. Something along the lines--prefer-bin-shims
that would then make npm create shell scripts instead of symlinks on Linux systems. The code for making those shell scripts is already there, and it works perfectly on my setup. The only thing missing is a command line option.Steps To Reproduce
npm install
npm install --no-bin-links
npx react-native
Environment
The text was updated successfully, but these errors were encountered: