2017-05-06 182 views
0

我有TypeScript 2.3.2。我用口水。错误:无法找到模块'三'

我安装three.js所这样的:

npm install @types/three --save-dev 

当我写命令gulp我看到的错误:

Error: Cannot find module 'three' from 
'E:\_Projects\8observer8.bitbucket.io\ThreeJS\BattleCity3D\src' 

截图:https://yadi.sk/d/wDK1SZ6U3HkCzu

+0

这是当我评论这一行:进口*三从 “三”;并将其替换为/// 为什么? – 8Observer8

+0

解决问题时不要编辑标题,而是写一个自己问题的答案。 –

+0

此外,避免代码的截图。将问题本身的相关代码作为预先格式化的文本。 –

回答

1

解决方案

我更换这一行:

// this line does't work. Error: Cannot find module 'three' from ... 
import * as THREE from "three"; 

通过这样的:

/// <reference path="../node_modules/@types/three/index.d.ts" />