packager: Error: ENAMETOOLONG: name too long, unlink
For over a month today, i have being battling and trying to package my app with this amazing tool. However, all my effort failed. I have asked numerous question in SO , yet no solution among which is this http://stackoverflow.com/questions/37561851/electron-packaging-with-electron-packager.
After reading some blogs and suggestions. I moved my electron.js to my home folder . Now i am having the error below

I am running electron versions
"electron-packager": "^7.0.3",
"electron-prebuilt": "^1.2.1",
On my machine

Please i read somewhere some one was suggesting he solved his by building on his VM instead of the MAC machine. Does it really not work on MAC ? Previously, my build works for other platforms. However , it does not work for Darwin platform as you can noticed in my previous question on SO
http://stackoverflow.com/questions/37561851/electron-packaging-with-electron-packager . Someone suggested it was not building with my node_modules and i should move my electron.js to where my node_modules folder is available. Now i did moved it and i am getting the error above. Please how and what is wrong with my electron ? I have being trying this for over a month today. Any help would be appreciated.
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Comments: 25 (11 by maintainers)
Clean out your output directories and try again. It seems you’re hitting a copy recursion loop.
FWIW I managed to figure out a non-hacky solution to this problem, and it is in the 8.5.2 release.
I finally found some time to look into this. I believe the problem is because the Docker image links
/tmpto the same directory as yourdocker-compose.ymlfile. Since that is the same directory as your source files, it will recurse over the temporary directory that Electron Packager creates,/tmp/electron-packager, in an infinite loop until the ENAMETOOLONG error is hit.To avoid this problem, I suggest setting
--tmpdir=falsewhenever you use Electron Packager in a Docker container, which disables using the temporary directory as a staging ground.had to explicitly set
--ignore=^.*electron-packager.*$to stop this loop happening. Was building in a docker container so I’m guessing tmp directory wasn’t set (setting--tmp=/tmpdidn’t change anything) and so current dir was used, leading to this copy loop. If this default behaviour of using the current directory as temp, should there also be a check if it conflicts with the source directory and therefore have a counter measure, such as creating a new directory in the current directory and automatically ignoring it?