1

I'm trying to run npm install in a folder on my FAT32 drive, and this is the error I'm getting:

$ npm install
/work/sites/project
└── (empty)

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.0.15: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! Linux 4.8.0-27-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.8
npm ERR! path ../semver/bin/semver
npm ERR! code EPERM
npm ERR! errno -1
npm ERR! syscall symlink

npm ERR! Error: EPERM: operation not permitted, symlink '../semver/bin/semver' -> '/work/sites/project/node_modules/accord/node_modules/.bin/semver'
npm ERR!     at Error (native)
npm ERR!  { Error: EPERM: operation not permitted, symlink '../semver/bin/semver' -> '/work/sites/project/node_modules/accord/node_modules/.bin/semver'
npm ERR!     at Error (native)
npm ERR!   errno: -1,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'symlink',
npm ERR!   path: '../semver/bin/semver',
npm ERR!   dest: '/work/sites/project/node_modules/accord/node_modules/.bin/semver',
npm ERR!   parent: 'accord' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     /work/sites/project/npm-debug.log
npm ERR! code 1
$

So far I understand that the problem is caused by FAT32 not supporting symlinks and/or chmod. But is it really true that there's no work-around for this?

There is an issue open for this on GitHub, where maintainers agree that this is a bug and should be fixed, but the thread has been idle for over a year now.

Also in the same thread user mgiorgino mentions that npm install run under Windows does not make this error. I don't have a chance to confirm this, so is there anyone on Windows who was able to successfully run npm install on a FAT32 file system? If yes, is there any way that we get the same functionality under Linux?

Finally, looking around the web I found FAT32 file system driver and FAT16/FAT32 filesystem implementation packages. Since both their documentation is very scarce, so I can't tell if they can help fix this problem?

Томица Кораћ
  • 2,542
  • 7
  • 35
  • 57

1 Answers1

6

Try updating npm by running npm install npm@latest -g. I ran that command and it updated to v4.0.2. The recent updates could contain a fix if it is code related. Command in footer of the npm docs page.

Disabling symlinks helped a number of users when using npm install on systems unable to create symlinks. To turn off npm using symlinks set bin-links to false in the npm config by running npm config set bin-links false. Optionally you can run npm install --no-bin-links each time. The first command makes the change to the npm config so you don't have to add the --no-bin-links flag each time you run npm install. This is the method recommended in the npm config docs to get npm working on systems/drives that don't support symlinks.

cmp-202
  • 312
  • 1
  • 5
  • Using [`npm-windows-upgrade`](http://stackoverflow.com/questions/18412129/how-do-i-update-node-and-npm-on-windows) for updating Node and NPM. one Windows. It is recommended by the NPM team. – cmp-202 Nov 19 '16 at 11:26
  • cmp-202 you're talking about NTFS. My question was about FAT32. I'm getting the exact same error both with and without `sudo`, although I shouldn't need `sudo` for the location I'm trying to install to. – Томица Кораћ Nov 19 '16 at 11:35
  • `--no-bin-links` seems to let the installation complete. Can you please explain what are the consequences of using it? How does omitting symlinks affect the installation? Do I lose any functionality like that? – Томица Кораћ Nov 19 '16 at 11:40
  • True yes sorry most of the above was based on a presumption it was windows but isnt. Try the symlink flag that might apply. – cmp-202 Nov 19 '16 at 11:40
  • opps. bin-links Default: true Type: Boolean Tells npm to create symlinks (or .cmd shims on Windows) for package executables. Set to false to have it not do this. This can be used to work around the fact that some file systems don't support symlinks, even on ostensibly Unix systems.The --no-bin-links argument will prevent npm from creating symlinks for any binaries the package might contain. – cmp-202 Nov 19 '16 at 11:51
  • Your comment must have gotten truncated. I went through the docs and also everything I could find about it for the last 20 minutes, but all I got is 'It prevents packages from creating any symlinks'. I can't really conclude what that means in practice. How not creating symlinks affects the entire installation? – Томица Кораћ Nov 19 '16 at 11:52
  • It looks, from the config docs, that config bin-links and command --no-bin-links are there spacifically for this problem and there isn't any caviets saying that package performace or function could be affected. – cmp-202 Nov 19 '16 at 11:57