Skip to content

created project folder tree too deep for windows #1298

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

Closed
aggro80 opened this issue Jul 7, 2016 · 8 comments
Closed

created project folder tree too deep for windows #1298

aggro80 opened this issue Jul 7, 2016 · 8 comments
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent type: bug/fix

Comments

@aggro80
Copy link

aggro80 commented Jul 7, 2016

Please provide us with the following information:

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
    Windows 7
  1. Versions. Please run ng --version. If there's nothing outputted, please
    run in a Terminal:
    node --version
    And paste the result here.
    angular-cli: 0.1.0
    node: 5.4.0
    os: win32 x64
  2. Repro steps. Was this an app that wasn't created using the CLI? What change did you
    do on your code? etc.

Issue is almost the same as it was in #1090, but I'm using node 5, instead of node 3, so the solution provided in that issue does not help. Also you need to have a base path of about 50 characters for the problem to occur.

  1. Go to directory: C:\myproject\myproject\subproject\src\main\resources\web
  2. Create project: ng new --skip-git myproject
  3. Try to delete it and see how it fails

Here is one of the problematic paths:
C:\MYPROJ1\MYPROJ1\SUBPRO1\src\main\web\NODE_M1\ANGULA1\NODE_M1\EMBER-1\NODE_M1\BROCCO1\NODE_M1\BABEL-1\NODE_M1\REGENE1\NODE_M1\defs\NODE_M1\yargs\NODE_M1\cliui\NODE_M1\CENTER1\NODE_M~1\ALIGN-1\NODE_M1\kind-of\node_modules\is-buffer

  • Problems seem to occur only under node_modules\angular-cli.
  • angular-cli paths are about 200 characters, so your base path needs to be about 50 characters for you to see the problem. If you create the project directly to the C-root, you won't see the problem.
  • While the path in this example if invented just for this purpose, this problem happened in real life project (I admit that the project could be structured better, but this is just what real life provides).

If you can't do anything about the 200 character long path, you could at least warn about this when creating a project or at least mention it in the documentation. But preferred solution would be not to create so long paths.

@rburnham52
Copy link

rburnham52 commented Jul 8, 2016

we had this problem with node before. i thought they had fixed it it in node 5, seems like they haven't completely fixed it

http://stackoverflow.com/questions/26155135/node-npm-windows-file-paths-are-too-long-to-install-packages

There are a couple of workarounds for this.I think using the rmdir command is the easiest

http://superuser.com/questions/78434/how-to-delete-directories-with-path-names-too-long-for-normal-delete

rmdir /S /Q

@jkuri
Copy link
Contributor

jkuri commented Jul 8, 2016

Thanks @Nitro52. @aggro80 did that solved your issue?

@alexpaluzzi
Copy link
Contributor

I have rimraf installed globally for this reason on my Windows boxes. It works great.

npm i rimraf -g
rimraf directory/

Be careful, of course.

@aggro80
Copy link
Author

aggro80 commented Jul 13, 2016

Solution 1: Every user does tricks to get around the angular-cli problems.
Solution 2: Users just don't use angular-cli as it is too hard
Solution 3: angular-cli is fixed so that it is easy to use

I have not seen any other package installed by npm to create paths this deep, so I have to assume the problem is somehow related either to angular-cli or the packages it uses.

I don't have the skills nor time to provide a fix for this issue (to angular-cli), so the best I could do is to bring the issue into your attention. I hope that you can provide a real fix to the angular-cli so that it doesn't create paths so deep.

@alexpaluzzi
Copy link
Contributor

alexpaluzzi commented Jul 13, 2016

I have not seen any other package installed by npm to create paths this deep, so I have to assume the problem is somehow related either to angular-cli or the packages it uses.

This is not an angular-cli problem. It's an npm and Windows problem. Specifically with some of the third-party dependencies.

This problem is not unique to this project in any way. Almost every Yeoman scaffold and seed project I use has npm dependencies that break the Windows limit. This is a very common issue and has been for a long time. At least a couple years.

@aggro80
Copy link
Author

aggro80 commented Jul 15, 2016

OK, but even if this problem is not unique to angular-cli, it still exists in angular-cli. If it is caused by a bug in npm, it is OK for me to link this ticket to npm ticket and wait for a fix and once the npm is fixed, this ticket can be closed.

That being said, this issue should have been fixed already in npm3:
https://docs.npmjs.com/how-npm-works/npm3

It could be that there are still bugs in npm and their planned system does not work(?), but it looks to me, that if angular-cli and all its dependencies would use the same versions of every package, everything should be flat. So simply upgrading some packages that give deepest paths, might give at least some help for this issue.

@filipesilva filipesilva added type: bug/fix P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent labels Jul 28, 2016
@filipesilva
Copy link
Contributor

This issue was caused by a bug in the CLI that caused an older version of npm to be used. It was fixed in #1250.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent type: bug/fix
Projects
None yet
Development

No branches or pull requests

5 participants