sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

Path too long

Open DavidFatena opened this issue 10 years ago • 11 comments

Creating project with Yeoman is making too deep structure of files which fires red errors during installation. The structure is so deep, I can't open it with Visual Studio (it freezes trying to load it all). Hack, I can't even delete the created folder (windows alerts something like Path too long, move it so you can delete it).

error

DavidFatena avatar Aug 19 '16 08:08 DavidFatena

Hi David. Can you add any information about your environment? What operating system, what version, etc? Is there any chance your machine is (or was) running a pre-release version of Windows 10 Anniversary?

patmill avatar Aug 19 '16 14:08 patmill

@patmill The message simply tells you that node-gyp cannot compile some/all modules. The problem is a common issue on NodeJS on Windows together with node-gyp. Monitor this for some customer using NodeJS and SharePoint for more than a year now. In most case I was able to solve this. It is mainly caused by a missing VC++ Build tools or inproper configuration on the client caused by VS installations sometimes. Microsoft has released a guideline for NodeJS on Windows that should solve some of the problem. Might something for the documentation. You will find it on: https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#c-and-nodejs-tell-me-more In addition there is also a documentation on how to solve the Max_Path issue on Windows.

What you are referring to is to enable longer path than 260 character and how to disable Max Path http://betanews.com/2016/05/29/long-paths-windows-10/

StfBauer avatar Aug 19 '16 17:08 StfBauer

Windows 10 Pro N 64bit, it is a fresh install since january 2016, so no pre-release version. Not really sure if there was a pre-release version installed in the past.

DavidFatena avatar Aug 22 '16 13:08 DavidFatena

Try updating npm. npm -g install npm@next I found this got me past the problem of paths that were too long on windows. The underlying problem here is that the LTS version of node doesn;t ship with npm 3

gavinbarron avatar Aug 22 '16 18:08 gavinbarron

Of note - this is also being discussed here - http://sharepoint.stackexchange.com/questions/191289/gulp-serve-error-cannot-find-module-microsoft-sp-build-web

patmill avatar Aug 22 '16 18:08 patmill

Fix being discussed is as follows: During yo @microsoft/sharepoint if we detect npm2 we will write an error message and not run npm install. A message will say to run npm install -g npm@3 (or npm install -g npm@next) and to then run npm install in your project.

Separately, we're thinking of writing an environment checker that can be run at any given time to see if there are issues.

patmill avatar Aug 22 '16 22:08 patmill

This npm -g install npm@next indeed fixed the issue. Thank you.

DavidFatena avatar Aug 23 '16 07:08 DavidFatena

Same here. Upgrading to npm 3 fixed the issue.

DAgafitei avatar Aug 23 '16 10:08 DAgafitei

Can someone add the "npm install npm -g" line to the HelloWorld tutorial to ensure that nobody tries to build this on an NPM < 3.0?

I made the mistake and had the same undeletable hierarchy of "node-modules" folders.

larslynch avatar Aug 23 '16 20:08 larslynch

@larslynch - I've added it to the machine setup step. We're also going to detect this state and print a warning. I've leave this bug open until that gets released.

patmill avatar Aug 23 '16 23:08 patmill

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

msft-github-bot avatar Jan 30 '20 12:01 msft-github-bot