错误:无法找到模块'三'
问题描述:
我有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'
答
解决方案
我更换这一行:
// 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" />
这是当我评论这一行:进口*三从 “三”;并将其替换为/// 为什么? –
8Observer8
解决问题时不要编辑标题,而是写一个自己问题的答案。 –
此外,避免代码的截图。将问题本身的相关代码作为预先格式化的文本。 –