0

I have checked out a dozen questions on Stackoverflow, but it is still not working.

I have the latest @angular/cli installed globally and also in my project. When I run ng version, this is the output:

Angular CLI: 8.3.23
Node: 10.15.3
OS: win32 x64
Angular: 8.0.3
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.803.23
@angular-devkit/build-angular     0.803.23
@angular-devkit/build-optimizer   0.803.23
@angular-devkit/build-webpack     0.803.23
@angular-devkit/core              8.3.23
@angular-devkit/schematics        8.3.23
@angular/cli                      8.3.23
@angular/http                     7.2.16
@ngtools/webpack                  8.3.23
@schematics/angular               8.3.23
@schematics/update                0.803.23
rxjs                              6.5.4
typescript                        3.4.5
webpack                           4.39.2

I tried

npm uninstall @angular/cli -g;
npm cache clean --force;
npm install @angular/cli -g;
npm cache verify;
close / open console;
cd <project>;
npm install;
ng --version; (result: 8.2.23)

Afterwards, I use ng build --prod, it creates a build directory instead of the dist directory.

Part of folder structure:

.vscode 
arm-templates 
build 
e2e 
node_modules 
server 
src 
deployment 
.gitignore 
angular.json 
azure-pipelines.yml 
buildscript.-s 
6
  • Can you share your angular.json? Commented Jan 31, 2020 at 9:39
  • can you please share content of your angular.json? there is supposed to be something like outputDir Commented Jan 31, 2020 at 9:39
  • check your file angular.json, there you has a "tag" outputPath (it's under projects-->your application-->architect-->build-->options ) Commented Jan 31, 2020 at 9:40
  • In the angular.json outPut path says build. When I replaced it with dist it worked as expected. Any idea why it is build by default? Cost me days to figure it out, should have asked for help earlier. Commented Jan 31, 2020 at 9:45
  • I mean outputPath instead of outPut. It solved my problem. Thanks. @BlindDespair Commented Jan 31, 2020 at 10:35

1 Answer 1

1

In your angular.json check outputPath. It's set to build atm I suppose. You can replace it with dist and so it will build into dist.

Sign up to request clarification or add additional context in comments.

4 Comments

Any idea why it is build by default?
as far as I know dist/{projectName} is default output. How old was this angular app? it might be that someone already set to build by hand or it used to build in older versions of angular(which I am not sure because I don't recall)... but if you do ng new with latest angular you will see that it sets to dist
It is 2 months old created by me making use of Web Template Studio (marketplace.visualstudio.com/…). Maybe that is the problem, I did not expect Microsoft to deviate from dist and introduce build to fml.
I would definitely blame that. You can check it by creating another empty angular project using this tool and see what kind of outputPath it uses

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.