错误:无法找到模块“三”

时间:2017-05-06 08:39:13

标签: typescript three.js gulp

我有TypeScript 2.3.2。我用gulp。

我像这样安装了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

1 个答案:

答案 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" />