angular / angular-cli

CLI tool for Angular
https://cli.angular.io
MIT License
26.77k stars 11.97k forks source link

ng build error when --source-dir given #8747

Closed surjit closed 6 years ago

surjit commented 6 years ago

Versions

Angular CLI: 1.5.5
Node: 6.11.4
OS: win32 x64
Angular: 5.0.5
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.5.5
@angular-devkit/build-optimizer: 0.0.34
@angular-devkit/core: 0.0.22
@angular-devkit/schematics: 0.0.39
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.5
@schematics/angular: 0.1.9
typescript: 2.4.2
webpack: 3.8.1

Repro steps

I created new app followed this command "ng new app2 -sd ./resources/assets/src -dir oo" After seeting --source-dir ./src should be completely inside ./resources/assets/src I was expecting it should be on --source-dir on ng build getting error error

Observed behavior

 ng build
ENOENT: no such file or directory, stat 'F:\clients\kravecity\test\ang\oo\resources\assets\src\tsconfig.app.json'
Error: ENOENT: no such file or directory, stat 'F:\clients\kravecity\test\ang\oo\resources\assets\src\tsconfig.app.json'
    at Error (native)
    at Object.fs.statSync (fs.js:1001:11)
    at AngularCompilerPlugin._setupOptions (F:\clients\kravecity\test\ang\oo\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:78:16)
    at new AngularCompilerPlugin (F:\clients\kravecity\test\ang\oo\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:43:14)
    at _createAotPlugin (F:\clients\kravecity\test\ang\oo\node_modules\@angular\cli\models\webpack-configs\typescript.js:77:16)
    at Object.getNonAotConfig (F:\clients\kravecity\test\ang\oo\node_modules\@angular\cli\models\webpack-configs\typescript.js:100:19)
    at NgCliWebpackConfig.buildConfig (F:\clients\kravecity\test\ang\oo\node_modules\@angular\cli\models\webpack-config.js:37:37)
    at Class.run (F:\clients\kravecity\test\ang\oo\node_modules\@angular\cli\tasks\build.js:30:92)
    at Class.run (F:\clients\kravecity\test\ang\oo\node_modules\@angular\cli\commands\build.js:216:26)
    at resolve (F:\clients\kravecity\test\ang\oo\node_modules\@angular\cli\ember-cli\lib\models\command.js:261:20)
    at Class.validateAndRun (F:\clients\kravecity\test\ang\oo\node_modules\@angular\cli\ember-cli\lib\models\command.js:240:12)
    at Promise.resolve.then.then (F:\clients\kravecity\test\ang\oo\node_modules\@angular\cli\ember-cli\lib\cli\cli.js:140:24)

Desired behavior

ng build should be successfully

Mention any other details that might be useful (optional)

when --source-dir set ./src should not created on current path and should be inside given path

clydin commented 6 years ago

Thanks for reporting this issue. However, this issue appears to be a duplicate of an existing issue #8417. Please subscribe to that issue for future updates.

angular-automatic-lock-bot[bot] commented 5 years ago

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.