angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

ng new with custom source-dir fails

Open dragonflypl opened this issue 9 years ago • 3 comments

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

@angular/cli: 1.4.1
node: 6.9.1
os: win32 x64

Repro steps.

  1. npm i -g @angular/[email protected]
  2. Run ng new:

ng new foogui --prefix foogui --style scss --routing true --skip-install true --skip-git true --source-dir src/main/client --dry-run

The log given by the failure.

Error: File foogui/src/app/app.module.ts does not exist.
File foogui/src/app/app.module.ts does not exist.

Desired functionality.

This is output from 1.3.2

  create .editorconfig
  create README.md
  create src\main\client\app\app-routing.module.ts
  create src\main\client\app\app.component.scss
  create src\main\client\app\app.component.html
  create src\main\client\app\app.component.spec.ts
  create src\main\client\app\app.component.ts
  create src\main\client\app\app.module.ts
  create src\main\client\assets\.gitkeep
  create src\main\client\environments\environment.prod.ts
  create src\main\client\environments\environment.ts
  create src\main\client\favicon.ico
  create src\main\client\index.html
  create src\main\client\main.ts
  create src\main\client\polyfills.ts
  create src\main\client\styles.scss
  create src\main\client\test.ts
  create src\main\client\tsconfig.app.json
  create src\main\client\tsconfig.spec.json
  create src\main\client\typings.d.ts
  create .angular-cli.json
  create e2e\app.e2e-spec.ts
  create e2e\app.po.ts
  create e2e\tsconfig.e2e.json
  create karma.conf.js
  create package.json
  create protractor.conf.js
  create tsconfig.json
  create tslint.json
Project 'foogui' successfully created.

Mention any other details that might be useful.

dragonflypl avatar Sep 11 '17 14:09 dragonflypl

I'm seeing different results when specifying a path outside of the 'src' directory. Only the app files are added to 'HOST', while all other files are still in 'src'.

ng new foo-ui --style scss --routing true --source-dir HOST --dry-run

create foo-ui/e2e/app.e2e-spec.ts (288 bytes) create foo-ui/e2e/app.po.ts (208 bytes) create foo-ui/e2e/tsconfig.e2e.json (235 bytes) create foo-ui/karma.conf.js (923 bytes) create foo-ui/package.json (1311 bytes) create foo-ui/protractor.conf.js (722 bytes) create foo-ui/README.md (1096 bytes) create foo-ui/tsconfig.json (363 bytes) create foo-ui/tslint.json (3040 bytes) create foo-ui/.angular-cli.json (1129 bytes) create foo-ui/.editorconfig (245 bytes) create foo-ui/.gitignore (516 bytes) create foo-ui/src/assets/.gitkeep (0 bytes) create foo-ui/src/environments/environment.prod.ts (51 bytes) create foo-ui/src/environments/environment.ts (387 bytes) create foo-ui/src/favicon.ico (5430 bytes) create foo-ui/src/index.html (292 bytes) create foo-ui/src/main.ts (370 bytes) create foo-ui/src/polyfills.ts (2480 bytes) create foo-ui/src/styles.scss (80 bytes) create foo-ui/src/test.ts (1085 bytes) create foo-ui/src/tsconfig.app.json (211 bytes) create foo-ui/src/tsconfig.spec.json (304 bytes) create foo-ui/src/typings.d.ts (104 bytes) create foo-ui/HOST/app/app-routing.module.ts (245 bytes) create foo-ui/HOST/app/app.module.ts (393 bytes) create foo-ui/HOST/app/app.component.html (1107 bytes) create foo-ui/HOST/app/app.component.spec.ts (1103 bytes) create foo-ui/HOST/app/app.component.ts (208 bytes) create foo-ui/host/app/app.component.scss (0 bytes)

EDIT: changed formatting

thekhoi avatar Sep 13 '17 20:09 thekhoi

I having the same issue in Windows using @angular/cli 1.5.4. A workaround you can use is manually move the files into the desired source directory, and fix the path references in "tsconfig.app.json".

alejunco avatar Nov 24 '17 22:11 alejunco

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.