Angular2和lodash ...找不到名称 [英] Angular2 and lodash...Cannot find name

查看:105
本文介绍了Angular2和lodash ...找不到名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Angular2和lodash ...为什么有那么多戏剧性?我的意思是真的...

Angular2 and lodash...why so much drama? I mean really...

下面是我的安装方式

npm install --save lodash
npm install --save @types/lodash

更新:

因此我关注了博客并进行了

I followed thus blog and did this angular2-and-lodash-cannot-find-name: npm install @types/lodash@ts2.0 --save-dev

有效.唯一的错误在于:

It worked. Only errors is with:

node_modules/@ types/茉莉花

node_modules/@types/jasmine

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 '_'.

推荐答案

只需更改您的package.json文件以使用此文件:

Simply change your package.json file to use this:

@types/jasmine@2.5.41 // Or 2.5.38

它应该解决该问题.

这篇关于Angular2和lodash ...找不到名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆