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

angular-cli: 1.0.0-beta-16; ng build --prod fails; either bits in dist are not complete or build fails

Open NilsHolger opened this issue 10 years ago • 5 comments

Please provide us with the following information:

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?) windows 7

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here: angular-cli: 1.0.0-beta.16 NODE: 6.5.0 os: win32 x64

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc. the app was created using the CLI added components, service

The log given by the failure.

Normally this include a stack trace and some more information. 94% asset optimizationError in bail mode: [default] c:\Dev\angular2showcaseapp
src\app\app.component.ts:5:12 Cannot find name 'require'.

Mention any other details that might be useful.

contents of app.component.ts import { Component } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { title = 'Angular 2 Rocks hardcore!'; }


Thanks! We'll be in touch soon.

NilsHolger avatar Oct 03 '16 05:10 NilsHolger

Same issue I am having.. whats your typescript version?

its2mc avatar Oct 04 '16 13:10 its2mc

Same issue here. I used this workaround:

npm install @types/node --save-dev

Maybe it should be included in package.json.

aecz avatar Oct 04 '16 18:10 aecz

fix : in typings.d.ts add: declare var require: any;

NilsHolger avatar Oct 04 '16 19:10 NilsHolger

Fixed in https://github.com/angular/angular-cli/pull/2528

filipesilva avatar Oct 09 '16 01:10 filipesilva

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.