I am running the latest version of the angular2 cli 1.0.0-rc.4 and I am having a problem with one of my libraries.
When I try to import the lodash library (or any library) with
import * as _ from 'lodash';
I will get the following error when building:
ERROR in C:/tfsrepos/Nexus/Nexus/my-app/src/app/app.component.ts (2,20): Cannot find module 'lodash
.)
If I instead try to import using the line
import 'lodash';
then it builds fine. However, now I can't use lodash because I haven't gotten it installed in any namespace. The following line
_.fill(array, 'a');
produces the error
Cannot find name '_'.
What is the issue here? My code works fine before I started trying to build using angular cli.
None of the solutions mentioned in this thread: Importing lodash into angular2 + typescript application work for me.