blueprints.forEach(function(b){^ TypeError:无法读取未定义的属性'forEach'

时间:2019-04-11 10:26:57

标签: node.js reactjs mern

运行merng命令时出现此错误:

AppData\Roaming\npm\node_modules\mern-cli\lib\commands\generate.js:43
blueprints.forEach(function (b) {
           ^

TypeError: Cannot read property 'forEach' of undefined
at Command.<anonymous> (C:\Users\ashwanipanwar\AppData\Roaming    \npm\node_modules\mern-cli\lib\commands\generate.js:43:16)
at Command.emit (events.js:182:13)
at Command.outputHelp (C:\Users\ashwanipanwar\AppData\Roaming\npm\node_modules\mern-cli\node_modules\commander\index.js:1142:8)
at Command.help (C:\Users\ashwanipanwar\AppData\Roaming\npm\node_modules\mern-cli\node_modules\commander\index.js:1152:8)
at Object.<anonymous> (C:\Users\ashwanipanwar\AppData\Roaming\npm\node_modules\mern-cli\lib\commands\generate.js:49:25)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)

问题是什么?

1 个答案:

答案 0 :(得分:-1)

我发现,由于merng需要arguments导致了错误。像merng module <moduleName>一样,这将创建一个模块。