Sublime Forum

Unable to open file when path is too long (Windows 8.1)

#1

Dear support,

I use Sublime Text 3 (Stable Channel, Build 3083) with Windows 8.1.
It works pretty well and I am glad to use it everyday!

The problem I am facing is with files which seem to have a path name too long. I work with Javascript packages and it is usual I have such paths:

If I do a full text search (CTRL + SHIFT + F) for any query string,
here is the message I get in the middle of my search results:

Unable to open C:\dev\project.com\node_modules\grunt-contrib-cssmin\node_modules\maxmin\node_modules\pretty-bytes\node_modules\meow\node_modules\normalize-package-data\node_modules\validate-npm-package-license\node_modules\spdx-correct\node_modules\spdx-license-ids\LICENSE
Unable to open C:\dev\project.com\node_modules\grunt-contrib-cssmin\node_modules\maxmin\node_modules\pretty-bytes\node_modules\meow\node_modules\normalize-package-data\node_modules\validate-npm-package-license\node_modules\spdx-correct\node_modules\spdx-license-ids\package.json
Unable to open C:\dev\project.com\node_modules\grunt-contrib-cssmin\node_modules\maxmin\node_modules\pretty-bytes\node_modules\meow\node_modules\normalize-package-data\node_modules\validate-npm-package-license\node_modules\spdx-correct\node_modules\spdx-license-ids\README.md
...

Sorry I need to hide my project name since I do not want it to be referenced yet :p.

I CAN open the file if I drag and drop it to a Sublime Text editor and I can see its content.


But from the Windows explorer, if I right click on the file, open it with Sublime Text, I see an empty file in Sublime Text.

And if I just close the tab of the file from Sublime Text, I get a popup asking me to save my changes.

Even worse… If I try to open the file LICENSE with my Windows explorer (right click, open with Sublime Text), I get the message “Unable to open these files: your Internet security settings prevent from opening one or many files.”

If I copy the file somewhere else to a shorter path, I can open it with Sublime Text.

Any idea on how to solve these issues?

0 Likes

#2

Yes, It’s a big problem with npm, he create node_module in node_module in node_module … But it’s finished with version 3.0, now all packages are on the same node_module :smile: ( in flat mode ). the path is too long is a problem with windows API, this API just allow 255 characters ( in memory ), so you need tools for remove this files ( remove with nodejs script, or I think 7-zip can make )

0 Likes

#3

Dear sovattha,

I was in same problem. You can use the “Long Path Tool” to get ride from the issue.

All the best.

Regards
Dominik

0 Likes

#4

Hi Dominik,
thank you for your help.
I downloaded “Long Path Tool” but I do not understand how it is supposed to interact with Sublime Text.

Is it the correct tool you mentionned?
http://longpathtool.com/

Cheers,
Sovattha

0 Likes

#5

I was facing same problem and i have recommended “long Path tool” from my friend and i used it and works well.

0 Likes

#6

Long Path Tool help me a lot when i have an issue like file deleting or renaming the file. Also good to use if file name and file extension is too long

0 Likes

#7

Hi,

I have a similar problem: the project on which I perform maintenance has too much arboressance and so I can not do an effective search …

There is a solution in your opinion

0 Likes