Skip to content
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

System.IO.PathTooLongException #12

Open
ghost opened this issue Apr 16, 2016 · 6 comments
Open

System.IO.PathTooLongException #12

ghost opened this issue Apr 16, 2016 · 6 comments

Comments

@ghost
Copy link

ghost commented Apr 16, 2016

Here is full error
System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
Program successfully creates nupkg file. Then gives error while executing this command;
C:\Users\sahip\AppData\Roaming\npm\node_modules\electron-installer-squirrel-windows\vendor\Update.com --releasify C:\Users\sahip\AppData\Local\Temp\ClientNode.0.1.0.nupkg --releaseDir C:\ --loadingGif C:\Users\sahip\AppData\Roaming\npm\node_modules\electron-installer-squirrel-windows\resources\install-spinner.gif

I am using Win7 64 Bit

Any idea?

@ghost
Copy link
Author

ghost commented Apr 16, 2016

Update:
Here is what I did;
I changed temp dir to c:\tmp
I moved npm dir to c:\npm(And also changed PATH to new npm path)
I changed "electron-installer-squirrel-windows" to "eisw" (And also in node_modules)
I started the command like that
C:\cn>eisw .\ --debug --loading_gif c:\is.gif

The failed command in logs is ;
C:\npm\node_modules\eisw\vendor\Update.com --releasify C:\temp\ClientNode.
0.1.0.nupkg --releaseDir C:\ --loadingGif c:\is.gif

I executed this command manually with no errors.
It does not seem Long path problem.

Output;

`C:\cn>eisw .\ --debug --loading_gif c:\is.gif
electron-installer-squirrel-windows generating squirrel-windows installer for
+0ms {
"_": [
"."
],
"debug": true,
"overwrite": false,
"loading_gif": "c:\is.gif",
"path": "."
}
[Error: 'ClientNode.0.1.0.nupkg' already exists! Run electron-installer-squirrel
-windows again with '--overwrite' or just remove the file at 'C:\ClientNode.0.1.
0.nupkg' yourself and run again.]

C:\cn>eisw .\ --debug --loading_gif c:\is.gif
electron-installer-squirrel-windows generating squirrel-windows installer for
+0ms {
"_": [
"."
],
"debug": true,
"overwrite": false,
"loading_gif": "c:\is.gif",
"path": "."
}
electron-installer-squirrel-windows creating temp directory +31ms
electron-installer-squirrel-windows generating .nuspec file contents +0ms
electron-installer-squirrel-windows .nuspec file contents:
+0ms ?


ClientNode
<title>ClientNode</title>
0.1.0
Nokta
Nokta
https://raw.githubusercontent.com/atom/electron/master/atom/browser
/resources/win/atom.ico
false
Gateway ClientNode
2016 Nokta













electron-installer-squirrel-windows writing nuspec file to 'C:\temp\ClientNode
.nuspec' +16ms
electron-installer-squirrel-windows copying 'C:\npm\node_modules\eisw\vendor\U
pdate.exe' -> 'Update.exe' +0ms
electron-installer-squirrel-windows generating 'C:\temp'... +31ms
electron-installer-squirrel-windows exec 'C:\npm\node_modules\eisw\vendor\nuge
t.exe' with args 'pack C:\temp\ClientNode.nuspec -BasePath .\ -OutputDirectory C
:\temp -NoDefaultExcludes' +0ms
stdout Attempting to build package from 'ClientNode.nuspec'.
Successfully created package 'C:\temp\ClientNode.0.1.0.nupkg'.
electron-installer-squirrel-windows no remote releases. skipping sync. +4m
electron-installer-squirrel-windows exec 'C:\npm\node_modules\eisw\vendor\Upda
te.com' with args '--releasify C:\temp\ClientNode.0.1.0.nupkg --releaseDir C:\ -
-loadingGif c:\is.gif' +0ms
Error { [Error: Command failed: C:\npm\node_modules\eisw\vendor\Update.com --re
leasify C:\temp\ClientNode.0.1.0.nupkg --releaseDir C:\ --loadingGif c:\is.gif
System.IO.PathTooLongException: The specified path, file name, or both are too l
ong. The fully qualified file name must be less than 260 characters, and the dir
ectory name must be less than 248 characters.
at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPath
Length, Boolean expandShortPaths)
at System.IO.Path.GetDirectoryName(String path)
at Squirrel.ReleasePackage.extractZipDecoded(String zipFilePath, String outFo
lder)
at Squirrel.ReleasePackage.CreateReleasePackage(String outputFile, String pac
kagesRootDir, Func'2 releaseNotesProcessor, Action'1 contentsPostProcessHook)
at Squirrel.Update.Program.Releasify(String package, String targetDir, String
packagesDir, String bootstrapperExe, String backgroundGif, String signingOpts,
String baseUrl, String setupIcon, Boolean generateMsi)
at Squirrel.Update.Program.executeCommandLine(String[] args)
at Squirrel.Update.Program.main(String[] args)
at Squirrel.Update.Program.Main(String[] args)
]
killed: false,
code: 4294967295,
signal: null,
cmd: 'C:\npm\node_modules\eisw\vendor\Update.com --releasify C:\temp\Cl
ientNode.0.1.0.nupkg --releaseDir C:\ --loadingGif c:\is.gif' }
System.IO.PathTooLongException: The specified path, file name, or both are too l
ong. The fully qualified file name must be less than 260 characters, and the dir
ectory name must be less than 248 characters.
at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPath
Length, Boolean expandShortPaths)
at System.IO.Path.GetDirectoryName(String path)
at Squirrel.ReleasePackage.extractZipDecoded(String zipFilePath, String outFo
lder)
at Squirrel.ReleasePackage.CreateReleasePackage(String outputFile, String pac
kagesRootDir, Func'2 releaseNotesProcessor, Action'1 contentsPostProcessHook)
at Squirrel.Update.Program.Releasify(String package, String targetDir, String
packagesDir, String bootstrapperExe, String backgroundGif, String signingOpts,
String baseUrl, String setupIcon, Boolean generateMsi)
at Squirrel.Update.Program.executeCommandLine(String[] args)
at Squirrel.Update.Program.main(String[] args)
at Squirrel.Update.Program.Main(String[] args
stdout
{ [Error: Command failed: C:\npm\node_modules\eisw\vendor\Update.com --releasify
C:\temp\ClientNode.0.1.0.nupkg --releaseDir C:\ --loadingGif c:\is.gif
System.IO.PathTooLongException: The specified path, file name, or both are too l
ong. The fully qualified file name must be less than 260 characters, and the dir
ectory name must be less than 248 characters.
at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPath
Length, Boolean expandShortPaths)
at System.IO.Path.GetDirectoryName(String path)
at Squirrel.ReleasePackage.extractZipDecoded(String zipFilePath, String outFo
lder)
at Squirrel.ReleasePackage.CreateReleasePackage(String outputFile, String pac
kagesRootDir, Func'2 releaseNotesProcessor, Action'1 contentsPostProcessHook)
at Squirrel.Update.Program.Releasify(String package, String targetDir, String
packagesDir, String bootstrapperExe, String backgroundGif, String signingOpts,
String baseUrl, String setupIcon, Boolean generateMsi)
at Squirrel.Update.Program.executeCommandLine(String[] args)
at Squirrel.Update.Program.main(String[] args)
at Squirrel.Update.Program.Main(String[] args)
]
killed: false,
code: 4294967295,
signal: null,
cmd: 'C:\npm\node_modules\eisw\vendor\Update.com --releasify C:\temp\Cl
ientNode.0.1.0.nupkg --releaseDir C:\ --loadingGif c:\is.gif' }

C:\cn>C:\npm\node_modules\eisw\vendor\Update.com --releasify C:\temp\ClientNode.
0.1.0.nupkg --releaseDir C:\ --loadingGif c:\is.gif

C:\cn>`

@santomegonzalo
Copy link

You could fix this problem if you use asar because if you don't use it windows will go to every package that you have inside node_modules and that could be huge... if you use asar its just like a zip so the packager will not look on every folder

@BastienvP3
Copy link

Maybe we could use the \?\ reference for long paths?

@JenRobertson
Copy link

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

  "config": {
    "forge": {
      "packagerConfig": {
        "asar": true
      },

@amiranagram
Copy link

@JenRobertson Thanks a lot.

@erikyuzwa
Copy link

erikyuzwa commented Apr 19, 2021

confirmed - this worked with ^6.0.0-beta.54 - thanks @JenRobertson !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants