-
Notifications
You must be signed in to change notification settings - Fork 358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Node/npm MAX_PATH issues #69
Comments
And by "direction", you mean "workaround", right? :-) There are a few options...
Luckily _#1/#_2 cover most cases. One thing to be aware of with this is that dedupe, flatten-packages, and upcoming changes in npm@3 might have an adverse effect on IntelliSense due to the way the analysis engine currently analyzes dependencies. I haven't heard any complaints yet, but until we fix this, your mileage may vary. With regards to the technicalities of max_path itself... the issue is with the .NET file I/O API, which doesn't allow you to use ?\ paths to work around it, and is too big for our team in particular to do much about. Here's a good article that might provide a little more context (it's a little old, and these "plans" they speak of never actually materialized.) That said... we don't like it either, and we are still thinking about what we can do. |
I am absolutely new to the environment of Node/NPM so bear with me for another set of questions. I successfully created a VS nodejs solution using the "From existing NodeJS code"
|
Np, they're good questions :-)
|
Also if you want support for jspm, the web essentials extension might be another route to making it happen: http://webessentials.uservoice.com/forums/140520-general/suggestions/7136766-add-support-for-jspm |
|
I was battling with path issues. I found that, for my situation, the following didn't work:
The only thing that did work was to install, trigger the path error, and use that to locate the most common offending module; uninstall; and then re-install the common module first. |
There is no good way around it on Windows. Making paths shorter either through global install or subst or renaming are all hacks and do not address the issue. Sooner or later you'll run into a situation when none of those work. The only solution as of now is move away from developing in node on Windows as Node is not fully compatible with it. Period. It is best to migrate sooner rather than later to avoid running into this issue when the project is at a stage when moving to a different OS can cause a lot of headache ... |
@mousetraps with As expected a package in this folder not in the package.json file displays as |
@MarkStega and the rest landing here. This feels a bit hacking in windows where I expected the NPM version that VS used would be the same as displayed on the command line. However, when updating NPM if you use To fix this you have to be a bit brave. Here are 7 simple yet scary steps.
I am using VS 2015RC and I didn't have to restart for this to take effect. I just deleted my projects node_module folder and ran the update missing packages command and everything worked with 3.1.1 referencing flat flat flat If this worked for you your free to delete your backup as you won't be needing it anymore. |
@mousetraps yeah, looks like your on this one. It'll be interesting to see what comes in the next few short weeks. Can't wait till RTM hits, these tools are invaluable for the VS Node Developer thanks! |
@itanex thx for posting the steps here. Also check out the npm-windows-upgrade package that was recently released which makes things a bit easier. Also 3.1.2 is out now which fixes some windows issues, so use the following instead. |
@mousetraps - Hi. Does this npm-windows-upgrade package fix the same problem NTVS 1.1 Tools for Windows 10 IoT Core? Does this apply to the MSFT's implementation of Node.js runtime with Chakra engine for Windows IoT Core - i.e. the deployed node.js applications using npm to pull the required modules? |
@NNM11 the package just makes it easier to upgrade to npm v3 (which is still very much in a beta state, and as I remarked above we are still working on supporting it fully in NTVS) Re: IoT none of the proposed node changes to enable chakra involve npm, so presumably you can just hotswap npm v3 the same way you'd normally do (plus accounting for different paths and such if need be). @munyirik can provide more details on that since he's the dev on the IoT extension. |
Hi @NNM11, ***Does this apply to the MSFT's implementation of Node.js runtime with Chakra engine for Windows IoT Core - i.e. the deployed node.js applications using npm to pull the required modules? |
Hi @munyirik, I would love to see a full support of the NPM@3 (to flatten the path) with NTVS 1.1 Tools with Win10 IoT Core. I can help evaluating the NMP3 support, if you have the node-gyp swapping procedure for the node.js Chakra engine for IoT core - I did not find a documented way to modify the node.js implementation for the IoT OS image. Thx |
Thanks @NNM11 . The swapping procedure should only be required if you're building a native node.js addon - I'll keep you posted when we have something working. For a pure JS package (e.g. Express), you can upgrade to npmv3 and use node.js (chakra) with it. BUT this is independent of NTVS (i.e. it works when testing through command line) - the integration of npmv3 and NTVS is what mousetraps is working on. |
Thanks @munyirik for the explanation. |
@MarkStega re: jspm - it's not full support, but check out this new VS extension |
1.1 RC2 is out with NPM3 support. That could helps with MAX_PATH issue. |
Oops - Forgot to comment; I installed the NPM3 beta (removing the NPM2 installation) a few weeks ago. It does solve the MAX_PATH issue (at least for the Aurelia navigation project). |
after flatten, restart VS, rebuild project |
👍 for @linquize tip After I Restarting VS solved the problem. Edit: I also reordered external web tools paths in the options so that PATH was above the vs one. Not sure if helped but I leave it here. |
I simply installed the latest npm with "npm install npm -g" and restarted Visual Studio. No "scary steps" necessary. Confirmed by deleting the old node_modules folder (which requires special treatment to delete the very long paths) and using Visual Studio to install missing packages. The newly installed packages used the new flattened structure as expected for NPM 3.x. |
Feel free to continue discussing, but I'm going to go ahead and close this issue in favor of the guidance available in our new Node.js Guidelines repo, which sums up many of the tips in this thread: https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#max_path-explanation-and-workarounds And of course, PRs are welcome 😃 |
Apparently the long paths issue on Windows is still not resolved with modern Node.js Opened an issue to revisit this |
There is a very well known issue with Node/NPM module management having to do with the maximum path length on Windows, see this exhausting thread: Node's nested node_modules approach is basically incompatible with Windows #6960 . So I am trying to build the new Aurelia framework (successor to Durandal and somewhat a competitor to Angular) and immediately ran into the issue when build of dependency modules failed because of the path. Is there any direction from Microsoft regarding this issue? With the seeming embrace of Node by MS having this flaw will be hurtful to adoption.
The text was updated successfully, but these errors were encountered: