Angular 2 cannot find module d3-cloud

2019-09-16 01:47发布

问题:

For my angular 2 app with typescript, Im using systemjs for modules and grunt for build In systemJsconfig file Im loading map :{ ..... 'd3': 'npm:d3/build/d3.js', 'd3-cloud' : 'npm:d3-cloud', } In my component: importing the d3 and d3-cloud import * as D3 from 'd3'; import * as cloud from 'd3-cloud';

D3 is working fine but d3 cloud is not loading. When I build using grund, it throws compile time error Cannot find Module 'd3-cloud'

Package.json: ..... "d3": "^4.2.6", "d3-cloud": "^1.2.1", .....

Any help will be much appreciated and thank you

回答1:

Forgot to add typings for d3-cloud. Now fixed