npm 3.x install fails on rename long paths in Windows/Azure npm 3.x install fails on rename long paths in Windows/Azure azure azure

npm 3.x install fails on rename long paths in Windows/Azure


We found a solution. It seems like npm 3.x is getting to this situation when it needs to rename a long path only when you upgrade from older npm.

Meaning, since we already had this deployment running with an older npm, when we upgraded to npm 3.6.0 it tried to flatten the existing deployment and crashed.

The solution was just to remove the node_modules and redeploy.


According your info, your custom module azure_util is build in npm <3.x version, which has nested the node_modules folders.

You can try the following steps before deploying your node.js application to Azure Web Apps:

  1. upgrade your local npm version up to 3.x version.
  2. run command npm dedupe in your application directory, which will flatten the tree. You can find the description in npm change log

After these operations, your application's node.js deps should flat list in node_modules folder. And it should prevent the npm rename.

If you still occur the issue on your local env, you can try to rebuild your custom dependency in npm 3.x version, to make the directory tree flat in advance.