【2.2】异常反馈 build 报错->确认是一个编辑器bug。

Simulator: ERROR: Uncaught TypeError: Cannot read property ‘realpath’ of undefined, location: __node_modules/fs.realpath/index.js:0:0
STACK:
[0]anonymous@__node_modules/fs.realpath/index.js:10
[1]__define@__node_modules/fs.realpath/index.js:69
[2]anonymous@__node_modules/fs.realpath/index.js:77
[3]run@src/modular.js:85
[4]_prepareFinished@src/cocos2d-jsb.js:9720
[5]anonymous@src/cocos2d-jsb.js:9749
[6]anonymous@src/cocos2d-jsb.js:24808
[7]anonymous@src/cocos2d-jsb.js:35019
[8]fireTimeout@jsb-adapter/jsb-builtin.js:2038
[9]tick@jsb-adapter/jsb-builtin.js:2000
[ERROR] (/Users/nantas/fireball-x/cocos2d-x-lite_22/cocos/scripting/js-bindings/jswrapper/v8/Object.cpp, 534): Invoking function (0x7ffc32c03eb0) failed!
at HTMLElement.print-simulator-log (/Applications/cocoscreator2.2/CocosCreator.app/Contents/Resources/app.asar/editor/builtin/scene/panel/messages/scene.js:1:1608)
at Object.e._dispatch (/Applications/cocoscreator2.2/CocosCreator.app/Contents/Resources/app.asar/editor-framework/lib/renderer/panel.js:1:1876)
at EventEmitter. (/Applications/cocoscreator2.2/CocosCreator.app/Contents/Resources/app.asar/editor-framework/lib/renderer/ipc.js:1:2952)
at EventEmitter.emit (events.js:194:13)

尝试过 删除缓存 重启引擎。

重新创建项目还有报错。 正在尝试重新安装2.2

重新安装还是有问题。

步骤:
1、代码创建js 脚本 被添加了不期望的代码。【非常奇怪为什么会加这句代码】

import { Glob } from “glob”;

// Learn cc.Class:
// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/class.html
// - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/class.html
// Learn Attribute:

2、出现此代码后 调试和发布就会出现 fs 未找到错误

3、并且 即使删除掉 此代码 问题依然存在。重启后正常。【猜测和代码的预先检测缓存库有关系】