Skip to content

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

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
aklinkert opened this issue Jun 14, 2016 · 10 comments
Closed

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

aklinkert opened this issue Jun 14, 2016 · 10 comments
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent type: bug/fix type: faq

Comments

@aklinkert
Copy link

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:~] $
@Trendy
Copy link

Trendy commented Jun 14, 2016

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

@Christopotamus
Copy link

Christopotamus commented Jun 16, 2016

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?

@aklinkert
Copy link
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.

@aklinkert
Copy link
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?

@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 Jun 16, 2016
@filipesilva
Copy link
Contributor

Possibly related: #1045

@adamduren
Copy link

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

@hansl
Copy link
Contributor

hansl commented Dec 5, 2016

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

@filipesilva
Copy link
Contributor

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

@alexispolak
Copy link

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

@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 type: faq
Projects
None yet
Development

No branches or pull requests

7 participants