TypeError:require不是Object.module.exports.map中的函数

准时

在用gulp commm编译node js项目时发生以下错误。

在public / js / app / app.node.js中:

var fs = require('fs');
             ^

TypeError:require不是Object.module.exports.map ../ file中的函数

我试图在当前项目中实现反应通量api调用。

更新:

添加后此错误已被删除

new dwebpack.DefinePlugin({ "global.GENTLY": false })

但目前发生以下错误。

return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                                                  ^

Error: ENOENT: no such file or directory, open '/types/mime.types'
    at Error (native)
    at Object.fs.openSync (fs.js:549:18)
    at Object.fs.readFileSync (fs.js:397:15)
    at Mime.load 
准时

回答自己的问题不是正确的方法,但是这样做对其他人有帮助,而且人们在寻找已回答的问题时也这样做。

作为我与节点版本有关的问题。我在最新的节点版本4.0.0上并且有问题。

因此安装了较低的节点版本0.12.7(在模板代码的package.json中指定)并由npm install进行了重建,从而解决了该问题。

我已经使用https://www.npmjs.com/package/n软件包安装了多个节点版本并选择了我想使用的版本。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

module.exports:不是函数

require和module.exports:TypeError:X不是一个函数

module.exports 函数不是函数

module.exports.report.logon不是函数

Module.exports:不是构造函数错误

typescript中的module.exports

Vuex模块中的import和module.exports显示未捕获的TypeError:无法分配为仅读取对象的属性'exports'

如何从函数内部修改module.exports?

如何从module.exports访问函数

节点JS在module.exports中调用“本地”函数

node.js中module.exports =函数的含义

如何将 .then() 函数的响应放在 module.exports 中?

在 module.exports 中使用的函数中未定义

在NodeJS中var export = module.exports = {}

从module.exports中的另一个函数调用module.exports中的“本地”函数?

如何使用module.exports和require()导出Node.js中的类和超类?

打字稿文件中的module.exports返回“模块不是模块”。

用module.exports用javascript和browserify理解require()

require():使用module.exports与直接分配给“ this”

前端的javascript节点module.exports / require()代码

函数未在 nodejs 上用 module.exports 定义

Node.js-使用module.exports作为构造函数

为什么 module.exports 不能正确导出函数?

Node.js module.exports函数从MongoDB返回数组

我的module.exports返回为[object Object]

module.exports从诺言

Firebase Cloud Functions 中 module.exports 和exports.functionName 的区别

CommonJs模块系统中“ module.exports”和“ exports”之间的区别

NodeJS / Express中的“ module.exports”和“ exports.methods”是什么意思?