Angular2和lodash ...爲什麼這麼多戲劇?我的意思是真的...Angular2和lodash ...找不到名字
下面是我如何安裝
npm install --save lodash
npm install --save @types/lodash
UPDATE:
我也跟着這樣的博客,這樣做,angular2-and-lodash-cannot-find-name: NPM安裝@類型/ lodash @ ts2.0 - save-dev
它工作。只有錯誤是:
node_modules/@類型/茉莉
ERROR in [default] /Users/dude/Documents/frontend/qta-angular2/node_modules/@types/jasmine/index.d.ts:40:37
A parameter initializer is only allowed in a function or constructor implementation.
ERROR in [default] /Users/dude/Documents/frontend/qta-angular2/node_modules/@types/jasmine/index.d.ts:40:45
Cannot find name 'keyof'.
ERROR in [default] /Users/dude/Documents/frontend/qta-angular2/node_modules/@types/jasmine/index.d.ts:40:51
'=' expected.
ERROR in [default] /Users/dude/Documents/frontend/qta-angular2/node_modules/@types/jasmine/index.d.ts:42:45
A parameter initializer is only allowed in a function or constructor implementation.
ERROR in [default] /Users/dude/Documents/frontend/qta-angular2/node_modules/@types/jasmine/index.d.ts:42:55
Cannot find name 'keyof'.
ERROR in [default] /Users/dude/Documents/frontend/qta-angular2/node_modules/@types/jasmine/index.d.ts:42:61
'=' expected.
ERROR in [default] /Users/dude/Documents/frontend/qta-angular2/node_modules/@types/jasmine/index.d.ts:58:41
Cannot find name 'Partial'.
ERROR in [default] /Users/dude/Documents/frontend/qta-angular2/node_modules/@types/jasmine/index.d.ts:99:21
Cannot find name 'Partial'.
ERROR in [default] /Users/dude/Documents/frontend/qta-angular2/node_modules/@types/jasmine/index.d.ts:99:34
Cannot find name 'Partial'.
ERROR in [default] /Users/dude/Documents/frontend/qta-angular2/node_modules/@types/lodash/index.d.ts:241:12
Duplicate identifier '_'.
ERROR in [default] /Users/dude/Documents/frontend/qta-angular2/node_modules/@types/lodash/index.d.ts:241:15
Cannot find namespace '_'.
ERROR in [default] /Users/dude/Documents/frontend/qta-angular2/node_modules/@types/lodash/index.d.ts:243:24
Cannot find name 'Partial'.
ERROR in [default] /Users/dude/Documents/frontend/qta-angular2/node_modules/@types/lodash/index.d.ts:245:18
Duplicate identifier '_'.
ERROR in [default] /Users/dude/Documents/frontend/qta-angular2/node_modules/@types/lodash/index.d.ts:362:38
Cannot find namespace '_'.
檢查'typings.json',看看這是你lodash ' 「lodash」: 「註冊表:NPM/lodash#4.0.0 + 20160305082308」' 如果不更改該犯lodash的,4.14.0是給你看到的錯誤。 – user3344978
不是,它不在文件中 – Tampa
這很可能是因爲軟件包的版本,請嘗試降低軟件包中的lodash,它的類型是 – Milad