SailsJs模块错误无效

时间:2014-12-09 13:57:44

标签: node.js express sails.js

安装lodash或异步插件后, 启动 sails.js 时,控制台会显示这些错误消息。 但我不知道是什么导致这些错误信息。

我需要解决这个问题。请任何人帮助我。

error: A hook (`userconfig`) failed to load!

error: Error: Invalid module:[object Object]

at /Users/johndo/github/sails/testProject/node_modules/sails/node_modules/sails-build-dictionary/index.js:83:15

at forOwn (/Users/johndo/github/sails/testProject/node_modules/lodash/dist/lodash.js:2105:15)

at Function.forEach (/Users/johndo/github/sails/testProject/node_modules/lodash/dist/lodash.js:3302:9)

at buildDictionary (/Users/johndo/github/sails/testProject/node_modules/sails/node_modules/sails-build-dictionary/index.js:74:4)

at Function.module.exports.aggregate (/Users/johndo/github/sails/testProject/node_modules/sails/node_modules/sails-build-dictionary/index.js:190:9)

at Array.loadOtherConfigFiles [as 0] (/Users/johndo/github/sails/testProject/node_modules/sails/lib/hooks/moduleloader/index.js:164:27)

at /Users/johndo/github/sails/testProject/node_modules/sails/node_modules/async/lib/async.js:459:38

at Array.forEach (native)

at _each (/Users/johndo/github/sails/testProject/node_modules/sails/node_modules/async/lib/async.js:32:24)

at Object.async.auto (/Users/johndo/github/sails/testProject/node_modules/sails/node_modules/async/lib/async.js:430:9) [Error: Invalid module:[object Object]]

error: Error: Invalid module:[object Object]

at /Users/johndo/github/sails/testProject/node_modules/sails/node_modules/sails-build-dictionary/index.js:83:15

at forOwn (/Users/johndo/github/sails/testProject/node_modules/lodash/dist/lodash.js:2105:15)

at Function.forEach (/Users/johndo/github/sails/testProject/node_modules/lodash/dist/lodash.js:3302:9)

at buildDictionary (/Users/johndo/github/sails/testProject/node_modules/sails/node_modules/sails-build-dictionary/index.js:74:4)

at Function.module.exports.aggregate (/Users/johndo/github/sails/testProject/node_modules/sails/node_modules/sails-build-dictionary/index.js:190:9)

at Array.loadOtherConfigFiles [as 0] (/Users/johndo/github/sails/testProject/node_modules/sails/lib/hooks/moduleloader/index.js:164:27)

at /Users/johndo/github/sails/testProject/node_modules/sails/node_modules/async/lib/async.js:459:38

at Array.forEach (native)

at _each (/Users/johndo/github/sails/testProject/node_modules/sails/node_modules/async/lib/async.js:32:24)

at Object.async.auto (/Users/johndo/github/sails/testProject/node_modules/sails/node_modules/async/lib/async.js:430:9) [Error: Invalid module:[object Object]]

1 个答案:

答案 0 :(得分:2)

在解析配置文件时,它看起来遇到了错误。尝试回滚您的更改。

此外,lodash和async在风帆中作为全局变量,因此您不需要安装它们。只需转到config / globals并取消注释_(lodash)。这可能会解决您的问题,因为帆可能在其安装的版本与您的版本之间存在冲突。