windows-installer: electron-winstaller only gives the error "the path specified, the file name or both are too long."
When creating the installer, it always gives the same error:
C:\Users\xDeltaFox\Desktop\Desktop\Programing\JavaScript\InfinityApp>npm run setup
> infinityapp@0.0.25 setup C:\Users\xDeltaFox\Desktop\Desktop\Programing\JavaScript\InfinityApp
> node build.js --force
creating windows installer
Error: Failed with exit code: 1
Output:
Tentando construir o pacote de 'infinityapp.nuspec'.
O caminho especificado, o nome do arquivo ou ambos sao muito longos. O nome de arquivo totalmente qualificado deve ter menos de 260 caracteres e o nome do diret�rio menos de 248 caracteres.
at ChildProcess.proc.on.code (C:\Users\xDeltaFox\Desktop\Desktop\Programing\JavaScript\InfinityApp\node_modules\electron-winstaller\lib\spawn-promise.js:62:16)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! infinityapp@0.0.25 setup: `node build.js --force`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the infinityapp@0.0.25 setup script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\xDeltaFox\AppData\Roaming\npm-cache\_logs\2017-12-24T13_22_37_506Z-debug.log
I do not know what to do anymore, can anyone help me?
About this issue
- Original URL
- State: open
- Created 7 years ago
- Reactions: 11
- Comments: 18 (2 by maintainers)
I fixed this by adding the following line to my package.json:
The error message says it all:
Trying to build the 'infinityapp.nuspec' package. The specified path, the file name, or both are too long. The fully qualified file name must be less than 260 characters and the directory name less than 248 characters. The project is nested in too many folders, making the file path length exceed the limit of allowed characters, which is 260. This was a limitation with Windows, but was removed in Windows 10, but you had to enable the removal of this limit (https://stackoverflow.com/questions/1880321/why-does-the-260-character-path-length-limit-exist-in-windows).Solution Move your project folder closer to the root directory so that the absolute path to your project does not exceed 260 characters
EDIT: Also ensure where you are attempting to save your output does not exceed the character limit.
@alexanderturinske I am also seeing this issue today. And my deepest project path goes max to 65 characters.
@SujitSingh move the project to the root folder works for me, also i found another solution if you are using
electron-packagerjust set the flag--asarWhere in package.json do I add this?
I have expanded paths enabled in my registry… Is there an option to force disable this check?
@jegj yes, you are correct. Installer from an
asarformat file works perfectly(in my other project). But in my case, I am running a local server inside the app 😆. So, I need the folder structure to serve static files.@alexanderturinske, below are options which I am using -
After approximately 15-20 mins, the command generates following errors.