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