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:~] $
I'm unable to reproduce this on OS X Yosemite (10.10.5), following the same steps.
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?
@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.
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?
Possibly related: https://github.com/angular/angular-cli/issues/1045
I can reproduce the issue with @apinnecke method. Removing the package.json in my home folder resolves the issue.
Closing this as package.json indicates where the project is.
This issue shouldn't happen anymore even with package.json in parent directories, due to the fix in https://github.com/angular/angular-cli/pull/4901.
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
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._
Most helpful comment
I can reproduce the issue with @apinnecke method. Removing the package.json in my home folder resolves the issue.