Open xDeltaFox opened 6 years ago
Any news about this issue?
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-packager
just set the flag --asar
@SujitSingh Also ensure the output path does not exceed the max amount of characters. Can you post your error, the options you are using, the file path to your folder, and the expected file path of your output?
@jegj yes, you are correct. Installer from an asar
format 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 -
const rootPath = path.join('./'); // C:\Demo_Tool\ <-- Root path
const outPath = path.join(rootPath, 'widget_builds');
const settings = {
appDirectory: path.join(outPath, 'demo-tool-win32'), // also tried names with underscore(_) and without hyphen(-).
outputDirectory: path.join(outPath, 'windows-installer'), // C:\Demo_Tool\widget_builds\windows-installer
noMsi: true,
authors: 'Sujit',
exe: 'demo-tool.exe',
};
After approximately 15-20 mins, the command generates following errors.
> demo-tool@0.2.0 create-installer-win C:\Demo_Tool
> node src/createInstaller.js
Well, sometimes you are not so lucky: Failed with exit code: 4294967295
Output:
System.AggregateException: One or more errors occurred. ---> 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.
at System.IO.Path.LegacyNormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
at System.IO.Path.InternalGetDirectoryName(String path)
at Squirrel.ReleasePackage.<>c__DisplayClass14_0.<extractZipWithEscaping>b__0()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at Squirrel.ReleasePackage.CreateReleasePackage(String outputFile, String packagesRootDir, 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, String frameworkVersion, Boolean generateDeltas)
at Squirrel.Update.Program.executeCommandLine(String[] args)
at Squirrel.Update.Program.main(String[] args)
at Squirrel.Update.Program.Main(String[] args)
---> (Inner Exception #0) 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.
at System.IO.Path.LegacyNormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
at System.IO.Path.InternalGetDirectoryName(String path)
at Squirrel.ReleasePackage.<>c__DisplayClass14_0.<extractZipWithEscaping>b__0()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()<---
@jegj I used --asar=true but I'm still having this problem. There is anything else I need to know?
@Arytecs did you try to move the project to the root folder ?? also i don't think this makes a difference but i used the flag as --asar
instead of --asar=true
Yes I tried this too...
Maybe you should update npm
, delete the node_modules
dir and try again
I fixed this by adding the following line to my package.json:
"config": {
"forge": {
"packagerConfig": {
"asar": true
},
@JenRobertson On your advice I added asar and it caused Packaging Application to run for over an hour doing nothing.
I have expanded paths enabled in my registry.. Is there an option to force disable this check?
did anyone manage to do it without setting asar to true?
I fixed this by adding the following line to my package.json:
"config": { "forge": { "packagerConfig": { "asar": true },
Where in package.json do I add this?
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.
I've enabled removing the limit via the registry, but still get the error when building. Is there somewhere to declare "longPathAware" value?
https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=powershell
Moving my application to /c/myapp rather than the typical /c/Users/User/Github/myapp did work as a workaround-
I fixed this by adding the following line to my package.json:
"config": { "forge": { "packagerConfig": { "asar": true },
Where in package.json do I add this?
you can add that just to the regular root level of the package.json
我也碰到这个问题了,用npm ls查看下有没有异常的第三方包,我用npm ls查看之后发现列表里有个跟我项目一样的npm包,用npm uninstall卸载了就没这个问题了
When creating the installer, it always gives the same error:
I do not know what to do anymore, can anyone help me?