Skip to content

App created by ng new is created in wrong place #1079

Closed

Description

@aklinkert

Tried to use ng new project-name. The project get's created, but the path is wrong. My source code is located in a my /src/apinnecke directory. When I execute the ng new project-name inside of /src/apinnecke the project get's created at /src/project-name. Steps to reproduce are as follows:

$ mkdir -p /src/apinnecke
$ cd /src/apinnecke/
$ ng new project-name
$ ls -a
. ..
$ ls -a ..
. .. project-name

Am i missing a configuration step or am I having a strange setup here? Totally confused. Took me about 10 minutes to find out where the project got created.

Host machine is an OSX El Capitan:

[apinnecke:~] 4s $ uname -a
Darwin minas-tirith 15.5.0 Darwin Kernel Version 15.5.0: Tue Apr 19 18:36:36 PDT 2016; root:xnu-3248.50.21~8/RELEASE_X86_64 x86_64
[apinnecke:~] $ ng --version
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
angular-cli: 1.0.0-beta.5
node: 5.11.1
os: darwin x64
[apinnecke:~] $

Activity

  1. Trendy commented on Jun 14, 2016

    @Trendy

    I'm unable to reproduce this on OS X Yosemite (10.10.5), following the same steps.

  2. Christopotamus commented on Jun 16, 2016

    @Christopotamus

    Can you post an ls -a of your /src directory? I know I have this problem with some yeoman generators which will create things in the wrong directory based on some hidden files ,so maybe that's what's going on there?

  3. aklinkert commented on Jun 16, 2016

    @aklinkert
    Author

    @Christopotamus sure thing.

    [apinnecke:/src] $ ll
    total 24
    drwxr-xr-x  12 apinnecke  admin   408B 16 Jun 11:24 .
    drwxr-xr-x  33 root       wheel   1,2K 13 Jun 15:50 ..
    -rw-r--r--@  1 apinnecke  admin   6,0K 11 Mär 08:51 .DS_Store
    drwxr-xr-x  13 apinnecke  admin   442B 14 Jun 15:49 apinnecke
    drwxr-xr-x   5 apinnecke  admin   170B 25 Mai 22:08 go
    drwxr-xr-x   4 apinnecke  admin   136B  4 Mai 16:38 temp
    -rw-r--r--@  1 apinnecke  admin    51B 11 Mär 08:51 wlan.txt
    drwxr-xr-x   8 apinnecke  admin   272B 20 Mai 13:08 zazu
    [apinnecke:/src] $ cd apinnecke/
    [apinnecke:/src/apinnecke] $ ll
    total 130640
    drwxr-xr-x  13 apinnecke  admin   442B 14 Jun 15:49 .
    drwxr-xr-x  12 apinnecke  admin   408B 16 Jun 11:24 ..
    drwxr-xr-x  17 apinnecke  admin   578B 20 Apr 14:47 conventional-github-releaser
    drwxr-xr-x  20 apinnecke  admin   680B 23 Apr 16:08 deployment-talk
    drwxr-xr-x   9 apinnecke  admin   306B 12 Mai 11:58 docker-nodejs-build-tools
    drwxr-xr-x   8 apinnecke  admin   272B 13 Jun 15:54 json-fixtures
    drwxr-xr-x   9 apinnecke  admin   306B 17 Mär 23:12 npm-publish-slack-bot
    drwxr-xr-x   9 apinnecke  admin   306B 16 Mär 22:37 npm-tooling-example
    drwxr-xr-x  17 apinnecke  admin   578B 14 Jun 15:50 project-name
    drwxr-xr-x@ 20 apinnecke  staff   680B 18 Apr 10:02 zazu-meetup-master
    -rw-r--r--@  1 apinnecke  staff    64M 15 Apr 09:00 zazu-meetup-master.zip
    drwxr-xr-x  20 apinnecke  admin   680B 20 Apr 00:11 zazujs-talk
    [apinnecke:/src/apinnecke] $

    Removed some of the source directories since it's internal stuff, but that's basically it.

  4. aklinkert commented on Jun 16, 2016

    @aklinkert
    Author

    OH! Got it. try to add a package.json in /src/package.json, that will reproduce the issue. Removed that one after testing the project-name stuff because it was a backup of something older, so I abandoned it.

    Can you please check now if you're able to reproduce?

  5. added
    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
    on Jun 16, 2016
  6. filipesilva commented on Jun 18, 2016

    @filipesilva
    Contributor

    Possibly related: #1045

  7. adamduren commented on Jun 22, 2016

    @adamduren

    I can reproduce the issue with @apinnecke method. Removing the package.json in my home folder resolves the issue.

  8. hansl commented on Dec 5, 2016

    @hansl
    Contributor

    Closing this as package.json indicates where the project is.

  9. filipesilva commented on Feb 26, 2017

    @filipesilva
    Contributor

    This issue shouldn't happen anymore even with package.json in parent directories, due to the fix in #4901.

  10. alexispolak commented on Mar 29, 2017

    @alexispolak

    Same to me, Ubuntu 16.10, Nodejs v6.10.1, npm 4.2.0 when i make "ng new Project-name" the folder is created in the root directory rather in the directory i am in. #5483

  11. 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.

  12. 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/fixtype: faq

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions