Skip to content

created project folder tree too deep for windows #1298

Closed

Description

@aggro80

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.

Activity

  1. rburnham52 commented on Jul 8, 2016

    @rburnham52

    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

  2. jkuri commented on Jul 8, 2016

    @jkuri
    Contributor

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

  3. alexpaluzzi commented on Jul 11, 2016

    @alexpaluzzi
    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.

  4. aggro80 commented on Jul 13, 2016

    @aggro80
    Author

    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.

  5. alexpaluzzi commented on Jul 13, 2016

    @alexpaluzzi
    Contributor

    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.

  6. aggro80 commented on Jul 15, 2016

    @aggro80
    Author

    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.

  7. added
    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
    on Jul 28, 2016
  8. filipesilva commented on Jul 28, 2016

    @filipesilva
    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.

  9. angular-automatic-lock-bot commented on Sep 6, 2019

    @angular-automatic-lock-bot

    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.

  10. locked and limited conversation to collaborators on Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgenttype: bug/fix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions