question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

electron-winstaller only gives the error "the path specified, the file name or both are too long."

See original GitHub issue

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?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:9
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
JenRobertsoncommented, Jul 19, 2020

I fixed this by adding the following line to my package.json:

  "config": {
    "forge": {
      "packagerConfig": {
        "asar": true
      },
4reactions
alexanderturinskecommented, Aug 31, 2018

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

electron-winstaller only gives the error "the path specified, the file ...
electron -winstaller only gives the error "the path specified, the file name or both are too long."
Read more >
electron forge 'make' failing due to too many characters
The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the...
Read more >
Electron Windows installer tutorial | Christian Engvall
node installers/windows/createinstaller.js. If you get an error complaining about to long path names, have a look at the asar tutorial.
Read more >
electron-winstaller | Yarn - Package Manager
Electron Installer. CircleCI. NPM module that builds Windows installers for Electron apps using Squirrel. Installing. npm install --save-dev electron- ...
Read more >
11 Ways to Fix "The System Cannot Find The Path Specified ...
If the error persists after giving the administrator access to Command Prompt, apply the next fix. 2. Ensure the File Isn't Password Protected....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found