none
VS2015 node_modules Issue

    Question

  • Hello Experts,

    I have installed VS2015 Community Edition in my windows 10 and trying to build one web application which was developed in VS2010, while build, it is creating a folder called node_modules and lot of sub folders and files, this causes an issue says: “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.” Can you help me?

    Thanks,

    Jasper Paul

    Tuesday, March 22, 2016 3:50 PM

Answers

  • Found the answer:
    node_modules is where npm dependencies are stored for Node.js applications. Prior to npm v3 the dependency structure was nested and would result in some very deep file paths depending on the library. In npm v3, the dependency structure was changed to a flat structure. This reduces the nesting and should eliminate this issue almost entirely.

    I have upgraded npm version to 3+ and then deleted the node_modules directory and then ran npm install within that directory in cmd.exe. Issue Solved !!

    • Marked as answer by Jasperpaul Wednesday, March 23, 2016 8:32 AM
    Wednesday, March 23, 2016 8:32 AM

All replies

  • Hi Jasperpaul,

    Here is similar problem solved: http://forums.asp.net/t/1944241.aspx?Website+publish+failing+due+to+file+path+being+too+long

    Add the following line of code in default PropertyGroup of web project file.

    <IntermediateOutputPath>..\Temp</IntermediateOutputPath>

    And here is a library called Zeta Long Paths that provides a .NET API to work with long paths.

    A very good article about this issue for .NET and PowerShell: .NET, PowerShell Path too Long Exception and a .NET PowerShell Robocopy Clone

    Hope this was helpful for you..

    Best regards!




    (If this was helpful for you, vote for it and propose it as an answer)

    Tuesday, March 22, 2016 7:43 PM
  • Found the answer:
    node_modules is where npm dependencies are stored for Node.js applications. Prior to npm v3 the dependency structure was nested and would result in some very deep file paths depending on the library. In npm v3, the dependency structure was changed to a flat structure. This reduces the nesting and should eliminate this issue almost entirely.

    I have upgraded npm version to 3+ and then deleted the node_modules directory and then ran npm install within that directory in cmd.exe. Issue Solved !!

    • Marked as answer by Jasperpaul Wednesday, March 23, 2016 8:32 AM
    Wednesday, March 23, 2016 8:32 AM