简体   繁体   中英

How to run angular application?

I'm on ubuntu 18.0.4. I had installed angular-cli. Using ng I tried creating new app conFusion with command: ng new conFusion -dir=./conFusion --style=scss . This is terminal after my command:

CREATE conFusion/README.md (1026 bytes)
CREATE conFusion/angular.json (3666 bytes)
CREATE conFusion/package.json (1315 bytes)
CREATE conFusion/tsconfig.json (408 bytes)
CREATE conFusion/tslint.json (2805 bytes)
CREATE conFusion/.editorconfig (245 bytes)
CREATE conFusion/.gitignore (503 bytes)
CREATE conFusion/src/favicon.ico (5430 bytes)
CREATE conFusion/src/index.html (296 bytes)
CREATE conFusion/src/main.ts (370 bytes)
CREATE conFusion/src/polyfills.ts (3194 bytes)
CREATE conFusion/src/test.ts (642 bytes)
CREATE conFusion/src/styles.scss (80 bytes)
CREATE conFusion/src/browserslist (388 bytes)
CREATE conFusion/src/karma.conf.js (964 bytes)
CREATE conFusion/src/tsconfig.app.json (166 bytes)
CREATE conFusion/src/tsconfig.spec.json (256 bytes)
CREATE conFusion/src/tslint.json (314 bytes)
CREATE conFusion/src/assets/.gitkeep (0 bytes)
CREATE conFusion/src/environments/environment.prod.ts (51 bytes)
CREATE conFusion/src/environments/environment.ts (642 bytes)
CREATE conFusion/src/app/app.module.ts (314 bytes)
CREATE conFusion/src/app/app.component.scss (0 bytes)
CREATE conFusion/src/app/app.component.html (1141 bytes)
CREATE conFusion/src/app/app.component.spec.ts (1004 bytes)
CREATE conFusion/src/app/app.component.ts (214 bytes)
CREATE conFusion/e2e/protractor.conf.js (752 bytes)
CREATE conFusion/e2e/tsconfig.e2e.json (213 bytes)
CREATE conFusion/e2e/src/app.e2e-spec.ts (305 bytes)
CREATE conFusion/e2e/src/app.po.ts (208 bytes)

NOTE: Run with "dry run" no changes were made.

It seems it's not successful in creating conFusion as I can't find the folder conFusion . After this ng-serve not working too.

fly@adil-flytxt-pc:~/myangular/ca1$ ng serve
Local workspace file ('angular.json') could not be found.

Please help.

The problem is that you are not using double dash, now it just sees -d , which means --dry-run . With --dry-run you get a preview of what files will be created where and what size they will be. It does not actually create the files

Try this command (the directory defaults to the project name):

ng new conFusion --style=scss

What is your global version of @angular-cli ? And can you print also the version of @angular-cli in your package.json with this command ?

$ cat package.json

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM