Como no utilizo yarn busque por npm (enlace).
En src/app/app.module.ts
Import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'
Lo agrego a los imports
FontAwesomeModule
Y esto me causa el siguiente error por consola:
Uncaught Error: Unexpected value 'undefined' imported by the module 'AppModule' at syntaxError (compiler.js:1016) at compiler.js:10584 at Array.forEach () at CompileMetadataResolver.push../node_modules/@angular/compiler/fesm5/compiler.js.CompileMetadataResolver.getNgModuleMetadata (compiler.js:10553) at JitCompiler.push../node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler._loadModules (compiler.js:23850) at JitCompiler.push../node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler._compileModuleAndComponents (compiler.js:23831) at JitCompiler.push../node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler.compileModuleAsync (compiler.js:23791) at CompilerImpl.push../node_modules/@angular/platform-browser-dynamic/fesm5/platform-browser-dynamic.js.CompilerImpl.compileModuleAsync (platform-browser-dynamic.js:143) at PlatformRef.push../node_modules/@angular/core/fesm5/core.js.PlatformRef.bootstrapModule (core.js:4352) at Object../src/main.ts (main.ts:11)
Actualización 1:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { routing, appRoutingProviders } from './app.routing';
import { DataTablesModule } from 'angular-datatables';
import { HttpClientModule } from '@angular/common/http';
import { ReactiveFormsModule } from '@angular/forms';
import { FontAwesomeModule } from '@fortawesome/fontawesome-free';
import { AppComponent } from './app.component';
import { HomeComponent } from './components/home.component';
import { ConversorPipe } from './pipes/conversorMayusMinus.pipe';
import { ErrorComponent } from './components/error.component';
import { CategoriaComponent } from './components/categoria.component';
import { ColorComponent } from './components/color.component';
@NgModule({
declarations: [
AppComponent,
HomeComponent,
ConversorPipe,
ErrorComponent,
CategoriaComponent,
ColorComponent,
],
imports: [
BrowserModule,
FormsModule,
HttpModule,
routing,
ReactiveFormsModule,
HttpClientModule,
DataTablesModule,
FontAwesomeModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Actualización 2:
Cambiar la siguiente linea de código
import { FontAwesomeModule } from '@fortawesome/fontawesome-free';
por esta :
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
Esto me genera el siguiente error:
./node_modules/@fortawesome/angular-fontawesome/fesm5/angular-fontawesome.js Module not found: Error: Can't resolve '@fortawesome/fontawesome-svg-core' in 'C:\wamp64\www\webapp\node_modules\@fortawesome\angular-fontawesome\fesm5'
Actualización 3: Agregar:
import { library } from '@fortawesome/fontawesome-svg-core';
Me genera el siguiente error:
Actualización 4:
Siguiendo la sugerencia de @LPZadkiel.