运行node.js时报错module is not defined

Kason
  • 158

写了一个很简单的模块,然后再另一个模块引用,报错module is not defined

1,这是目录结构:

clipboard.png

2,这是内容:

clipboard.png

clipboard.png

3,这是报的错误

Administrator@WIN10-20181106R MINGW64 ~/Desktop/test
$ node Demo.js
C:\Users\Administrator\Desktop\test\User.js:1
(function (exports, require, module, __filename, __dirname) { moudle.exports  =
{
                                                              ^

ReferenceError: moudle is not defined
    at Object.<anonymous> (C:\Users\Administrator\Desktop\test\User.js:1:63)
    at Module._compile (internal/modules/cjs/loader.js:722:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:733:10)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
    at Function.Module._load (internal/modules/cjs/loader.js:552:3)
    at Module.require (internal/modules/cjs/loader.js:658:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (C:\Users\Administrator\Desktop\test\Demo.js:1:74)
    at Module._compile (internal/modules/cjs/loader.js:722:30)

请问这该怎么办??感谢

回复
阅读 8.7k
1 个回答

module

而不是
❌ moudle

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
宣传栏