I've been incorporating lodash into my angular2 project. Here are the commands I used:
$ npm install --save lodash
$ npm install --save @types/lodash
Upon installing lodash, warning messages popped up for both the main library and the types: https://i.stack.imgur.com/bz9aN.png
And a similar situation occurred with the types: https://i.stack.imgur.com/OtkCp.png
Despite these warnings, I proceeded with the installation. In my component file, I included this line:
import * as _ from 'lodash';
However, upon compiling the app, the console returned a series of errors:
ERROR in [default] /path/to/project/node_modules/@types/lodash/index.d.ts:244:12
Duplicate identifier '_'.
ERROR in [default] /path/to/project/node_modules/@types/lodash/index.d.ts:244:15
Cannot find namespace '_'.
...
(Additional error log truncated for brevity)
...
ERROR in [default] /path/to/project/node_modules/@types/lodash/index.d.ts:19441:0
Declaration or statement expected.
package.json
{
"name": "final-project",
"version": "0.0.0",
"license": "MIT",
...
My question is, am I overlooking something important here? Is there a requirement to address the PEER DEPENDENCIES? And if so, how should I go about it?