小编Bjo*_*uiz的帖子

需要discordjs时出错:“找不到模块‘node:events’”

我正在尝试开发一个机器人来表达不同意见。我安装了该npm install discord.js --save库。但是导入的时候却报错。我该如何修复它?

命令:node .

internal/modules/cjs/loader.js:892
  throw err;
  ^

Error: Cannot find module 'node:events'
Require stack:
- C:\Users\Gobs\Desktop\blog3\node_modules\discord.js\src\client\BaseClient.js
- C:\Users\Gobs\Desktop\blog3\node_modules\discord.js\src\index.js
- C:\Users\Gobs\Desktop\blog3\main.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
    at Function.Module._load (internal/modules/cjs/loader.js:745:27)
    at Module.require (internal/modules/cjs/loader.js:961:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (C:\Users\Gobs\Desktop\blog3\node_modules\discord.js\src\client\BaseClient.js:3:22)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
    at Module.load (internal/modules/cjs/loader.js:937:32)
    at Function.Module._load (internal/modules/cjs/loader.js:778:12)
    at Module.require (internal/modules/cjs/loader.js:961:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\Gobs\\Desktop\\blog3\\node_modules\\discord.js\\src\\client\\BaseClient.js',
    'C:\\Users\\Gobs\\Desktop\\blog3\\node_modules\\discord.js\\src\\index.js',
    'C:\\Users\\Gobs\\Desktop\\blog3\\main.js'
  ]
}
Run Code Online (Sandbox Code Playgroud)

JSON

{
    ...
    "main": "main.js",
    "scripts": {
    },
    "dependencies": {
        "discord.js": "^13.2.0"
    }
    ... …
Run Code Online (Sandbox Code Playgroud)

javascript node.js discord.js

13
推荐指数
1
解决办法
5万
查看次数

TypeError:无法读取未定义的属性(读取“集合”)-Vuejs 和 Firebase

我正在尝试开发一个包含任务的日历。我正在尝试使用 firebase,但它不断给出错误,表示它不理解“collection()”属性。我已经研究了很多东西,尝试用其他方法来做,但我什么也没得到。如果我不这样做,我可以注册,但用“集合”读取数据,不行。详细信息我正在使用 firebase 版本 9

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'collection')
Run Code Online (Sandbox Code Playgroud)

我不知道还能做什么,有人可以帮助我吗?整个脚本如下。

脚本

export default {
  data: () => ({
    today: new Date().toISOString().substr(0, 10),
    focus: new Date().toISOString().substr(0, 10),
    type: 'month',
    typeToLabel: {
      month: 'Month',
      week: 'Week',
      day: 'Day',
      '4day': '4 Days',
    },
    name: null,
    details: null,
    start: null,
    end: null,
    color: '#1976D2', // default event color
    currentlyEditing: null,
    selectedEvent: {},
    selectedElement: null,
    selectedOpen: false,
    events: [],
    dialog: false
  }),
  mounted () {
    this.getEvents()
  },
  computed: …
Run Code Online (Sandbox Code Playgroud)

javascript firebase vue.js vuejs2 google-cloud-firestore

5
推荐指数
1
解决办法
2万
查看次数