"找不到模块'三'从"

时间:2018-03-29 01:01:50

标签: typescript gulp browserify

我很难将我的玩具打字稿应用程序从typings @types/npm迁移到Error: Cannot find module 'three'

我无法弄清楚的错误是Error: Cannot find module 'codemirror'typescript/gulp/browserify

工作流程为typings.json

对于该迁移,我删除了gulpfile以及npm install @types///<reference path="typings/index.d.ts"/>中的所有输入内容。

然后,在升级类型定义后,由于某些API更改,我修复了一些错误。

我将import * as THREE from 'three';替换为[13:41:56] Using gulpfile mega-structure/gulpfile.js [13:41:56] Starting 'default'... [13:41:56] Starting '.bower.install'... [13:41:58] Using cwd: mega-structure [13:41:58] Using bower dir: ./bower_components [13:42:01] Finished '.bower.install' after 4.99 s [13:42:01] Starting '.peg'... [13:42:01] Finished '.peg' after 131 ms [13:42:01] Starting '.examples'... [13:42:01] Finished '.examples' after 155 ms [13:42:01] Starting '.ui.release'... events.js:183 throw er; // Unhandled 'error' event ^ Error: Cannot find module 'three' from 'mega-structure' at mega-structure/node_modules/browser-resolve/node_modules/resolve/lib/async.js:46:17 at process (mega-structure/node_modules/browser-resolve/node_modules/resolve/lib/async.js:173:43) at ondir (mega-structure/node_modules/browser-resolve/node_modules/resolve/lib/async.js:188:17) at load (mega-structure/node_modules/browser-resolve/node_modules/resolve/lib/async.js:69:43) at onex (mega-structure/node_modules/browser-resolve/node_modules/resolve/lib/async.js:92:31) at mega-structure/node_modules/browser-resolve/node_modules/resolve/lib/async.js:22:47 at FSReqWrap.oncomplete (fs.js:152:21)

它现在无法捆绑,我试图找出它没有成功:

splines::bs(x, df = 6)

请参阅http://ssrb.github.io/mega-structure/mega-structure.htmlhttps://github.com/ssrb/mega-structure/commit/3285f5cb45c110d87ea5db795e47a4a392a15c1f

1 个答案:

答案 0 :(得分:0)

问题是构建正在消耗three.jscodemirror,......安装npm的类型声明,但仍使用{安装了匹配的javascript库{1}}。 使用bower而不是npm安装库后,恢复了构建。