x)- [x ] bug report -> please search issues before submitting
- [ ] feature request
Output from: ng --version.
@angular/cli: 1.1.3
node: 7.2.1
os: win32 x64
mkdir project
cd project
npm init -y
mkdir client
cd client
ng new my-app --directory . --skip-install
User expectation at this point is that the CLI to create a new app in the current working directory, that is 'client' directory. But the CLI tries to create the app at the parent directory 'project'.
Without any supplied value (.) to --directory option, app is created in the parent directory where a package.json exists.
Output from above ng new command:
Unable to find "@angular/cli" in devDependencies.
Please take the following steps to avoid issues:
"npm install --save-dev @angular/cli@latest"
installing ng
? Overwrite package.json? (yndH)
CLI with --directory option assumes current working directory '.' (single period) as the root parent where a package.json exists.
In a single monolithic repository, it is important to differentiate relative paths. With the command supplied in the repro steps, the app should be created in the client directory.
Can someone please point me to the --directory documentation?
It confuses CLI, if there is a package.json exists at the root directory. Even ng -v will result in below warning
Unable to find "@angular/cli" in devDependencies.
Please take the following steps to avoid issues:
"npm install --save-dev @angular/cli@latest"
Please have a look at below steps:
mkdir project
cd project
npm init -y
mkdir client
cd client
mkdir web-client
ng new web-app --directory ./web-client --skip-install
User expectation is to get the new app created inside project/client/web-client directory. But the web-app is created inside root folder 'project' since there is a package.json.
@filipesilva
Upgraded NPM, Node along with CLI to the latest version. This works like a charm with the below version of CLI..
@angular/cli: 1.2.0
node: 8.1.3
npm: 5.0.3
os: win32 x64
mkdir project
cd project
npm init -y
mkdir client
cd client
mkdir web-client
ng new web-app --directory=./web-client -si
Above ng new successfully created the app in web-client directory. Getting below warning, but that's not a problem at all.
Unable to find "@angular/cli" in devDependencies.
Please take the following steps to avoid issues:
"npm install --save-dev @angular/cli@latest
Since this is working on the latest version of CLI, I am closing this issue. Thanks.
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
@filipesilva
Upgraded NPM, Node along with CLI to the latest version. This works like a charm with the below version of CLI..
Above ng new successfully created the app in web-client directory. Getting below warning, but that's not a problem at all.
Unable to find "@angular/cli" in devDependencies.
Please take the following steps to avoid issues:
"npm install --save-dev @angular/cli@latest
Since this is working on the latest version of CLI, I am closing this issue. Thanks.