In windows, when npm install length restrictions

When I try to install a certain npm package with a lot of dependencies, the paths start to exceed the limit I still have due the shared folder being where it is.
VirtualBox on windows cannot generate paths longer than ~260 characters on windows.
How can i do?

There is a node package that collapses the folder structure. I can’t remember the name of it, and I haven’t tried it for my projects, yet. But it’s out there and at least this gives you a place to start.

It’s called flatten-packages:

You can find this common problem in windows, for resolving length issue try LongPathTool program.