angular / angular-cli

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

Build error The Broccoli Plugin: [BroccoliTypeScriptCompiler] failed with: #782

Closed kamilshahzad closed 8 years ago

kamilshahzad commented 8 years ago

Please provide us with the following information:

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?) Win 10
  2. Versions. Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version And paste the result here. node: 6.1.0
  3. Repro steps. Was this an app that wasn't created using the CLI? What change did you do on your code? etc i just Create new app and using ng new pro.
  4. The log given by the failure. Normally this include a stack trace and some more information. Build error

The Broccoli Plugin: [BroccoliTypeScriptCompiler] failed with: Error: Typescript found the following errors: C:/Users/kamil/ng2/pro5/tmp/broccoli_type_script_compiler-input_base_path-SPob0I1X.tmp/0/src/main.ts (3, 10): Module '"C:/Users/kamil/ng2/pro5/tmp/broccoli_type_script_compiler-input_base_path-SPob0I1X.tmp/0/src/app"' has no exported member 'Pro5AppComponent'. C:/Users/kamil/ng2/pro5/tmp/broccoli_type_script_compiler-input_base_path-SPob0I1X.tmp/0/src/main.ts (3, 28): Module '"C:/Users/kamil/ng2/pro5/tmp/broccoli_type_script_compiler-input_base_path-SPob0I1X.tmp/0/src/app"' has no exported member 'environment'. at BroccoliTypeScriptCompiler._doIncrementalBuild (C:\Users\kamil\ng2\pro5\node_modules\angular-cli\lib\broccoli\broccoli-typescript.js:115:19) at BroccoliTypeScriptCompiler.build (C:\Users\kamil\ng2\pro5\node_modules\angular-cli\lib\broccoli\broccoli-typescript.js:43:10) at C:\Users\kamil\ng2\pro5\node_modules\angular-cli\node_modules\broccoli-caching-writer\index.js:152:21 at lib$rsvp$$internal$$tryCatch (C:\Users\kamil\ng2\pro5\node_modules\angular-cli\node_modules\broccoli-caching-writer\node_modules\rsvp\dist\rsvp.js:1036:16) at lib$rsvp$$internal$$invokeCallback (C:\Users\kamil\ng2\pro5\node_modules\angular-cli\node_modules\broccoli-caching-writer\node_modules\rsvp\dist\rsvp.js:1048:17) at lib$rsvp$$internal$$publish (C:\Users\kamil\ng2\pro5\node_modules\angular-cli\node_modules\broccoli-caching-writer\node_modules\rsvp\dist\rsvp.js:1019:11) at lib$rsvp$asap$$flush (C:\Users\kamil\ng2\pro5\node_modules\angular-cli\node_modules\broccoli-caching-writer\node_modules\rsvp\dist\rsvp.js:1198:9) at _combinedTickCallback (internal/process/next_tick.js:67:7) at process._tickCallback (internal/process/next_tick.js:98:9)

The broccoli plugin was instantiated at: at BroccoliTypeScriptCompiler.Plugin (C:\Users\kamil\ng2\pro5\node_modules\angular-cli\node_modules\broccoli-caching-writer\node_modules\broccoli-plugin\index.js:10:31) at BroccoliTypeScriptCompiler.CachingWriter as constructor at BroccoliTypeScriptCompiler (C:\Users\kamil\ng2\pro5\node_modules\angular-cli\lib\broccoli\broccoli-typescript.js:27:5) at Angular2App._getTsTree (C:\Users\kamil\ng2\pro5\node_modules\angular-cli\lib\broccoli\angular2-app.js:280:18) at Angular2App._buildTree (C:\Users\kamil\ng2\pro5\node_modules\angular-cli\lib\broccoli\angular2-app.js:101:23) at new Angular2App (C:\Users\kamil\ng2\pro5\node_modules\angular-cli\lib\broccoli\angular2-app.js:42:23) at module.exports (C:\Users\kamil\ng2\pro5\angular-cli-build.js:6:10) at Class.module.exports.Task.extend.setupBroccoliBuilder (C:\Users\kamil\ng2\pro5\node_modules\angular-cli\node_modules\ember-cli\lib\models\builder.js:55:19) at Class.module.exports.Task.extend.init (C:\Users\kamil\ng2\pro5\node_modules\angular-cli\node_modules\ember-cli\lib\models\builder.js:89:10) at new Class (C:\Users\kamil\ng2\pro5\node_modules\angular-cli\node_modules\ember-cli\node_modules\core-object\core-object.js:18:12) at Class.module.exports.Task.extend.run (C:\Users\kamil\ng2\pro5\node_modules\angular-cli\node_modules\ember-cli\lib\tasks\serve.js:15:19) at C:\Users\kamil\ng2\pro5\node_modules\angular-cli\node_modules\ember-cli\lib\commands\serve.js:64:24 at lib$rsvp$$internal$$tryCatch (C:\Users\kamil\ng2\pro5\node_modules\angular-cli\node_modules\ember-cli\node_modules\rsvp\dist\rsvp.js:1036:16) at lib$rsvp$$internal$$invokeCallback (C:\Users\kamil\ng2\pro5\node_modules\angular-cli\node_modules\ember-cli\node_modules\rsvp\dist\rsvp.js:1048:17) at lib$rsvp$$internal$$publish (C:\Users\kamil\ng2\pro5\node_modules\angular-cli\node_modules\ember-cli\node_modules\rsvp\dist\rsvp.js:1019:11) at lib$rsvp$asap$$flush (C:\Users\kamil\ng2\pro5\node_modules\angular-cli\node_modules\ember-cli\node_modules\rsvp\dist\rsvp.js:1198:9)

  1. Mention any other details that might be useful.

    Thanks! We'll be in touch soon.

pkamdem commented 8 years ago

@kamilshahzad You need to run your Command Prompt as Admin. Please refer to the CLI known issues

kamilshahzad commented 8 years ago

I am running CLI as admin and still facing this issue

kamilshahzad commented 8 years ago

Now facing Cannot read property sourcedir of undefined

although i tried https://github.com/hansl/angular-cli/commit/ff66eca9eb717e1dace86bf9e3813d5b0abef9c9 but yesterday it was resolved somehow now again same error as well when i resolve this then i will receive Build error The Broccoli Plugin: [BroccoliTypeScriptCompiler] Please be specific of how to resolve it or upload some new updates. Most of my developers are facing same issue in windows 10.

pkamdem commented 8 years ago

@kamilshahzad

What is your CLI version?

kamilshahzad commented 8 years ago

cli version is 0.0.39 i downgrade node to 4.4.4 also downgrade npm 2.15 now facing same errors cannot read property sourcedir of undefined

Aidurber commented 8 years ago

@kamilshahzad Add sourceDir to your angular-cli.json:

Here is my angular-cli.json file:

{
  "routes": [],
  "defaults": {
    "sourceDir": "src/client"
  }
}

More info: https://github.com/angular/angular-cli/issues/616

kamilshahzad commented 8 years ago

{

"routes": [], "defaults": { "sourceDir": "src/client" }, "project": { "version": "<%= version %>", "name": "<%= htmlComponentName %>" }, "apps": [ {"main": "<%= sourceDir %>/main.ts", "tsconfig": "<%= sourceDir %>/tsconfig.json"} ], "addons": [], "packages": [], "e2e": { "protractor": { "config": "config/protractor.conf.js" } }, "test": { "karma": { "config": "config/karma.conf.js" } }

}

I updated this but still same issue

DrLeeroyPhD commented 8 years ago

I'm having the same issue. The bash gets hung up and upon going to port 4200, I receive the same message as @kamilshahzad

Brocco commented 8 years ago

@kamilshahzad you are using an outdated version of the CLI, the current version is beta 5 (available via npm). Please update and re-generate your project.

filipesilva commented 8 years ago

https://github.com/angular/angular-cli/pull/905 should allow non-admin user usage.

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.