模块 sockjs-client 没有导出成员 "SockJS"

Module sockjs-client has no exported member "SockJS"

我正在尝试从 sockjs-client 库中导入 SockJS。我正在使用 Aurelia 和打字稿,但是在尝试使用

导入它时
import { SockJS } from 'sockjs-client';

它在 VS2015 中说:"Module sockjs-client has no exported member "SockJS""

package.json 看起来像这样:

 "jspm": {
    "dependencies": {
     //......
  "sockjs": "npm:sockjs@^0.3.17",
  "sockjs-client": "npm:sockjs-client@^1.1.1",
  "stompjs": "npm:stompjs@^2.3.3",
},
"devDependencies": {}
}

有人可以帮忙吗?

尝试:

import SockJS = require('sockjs-client');

尝试安装 sockjs-client typings npm install --save @types/sockjs-client 然后导入 import * as SockJS from 'sockjs-client';

仅此一项就可以解决问题:npm install --save-dev @types/sockjs-client 不需要导入为。来自TS