【问题标题】:I keep getting an error when trying to start my discord bot尝试启动我的不和谐机器人时不断收到错误消息
【发布时间】:2020-09-17 05:53:15
【问题描述】:
    PS C:\Users\netin\Desktop\bot> node .
internal/modules/cjs/loader.js:1032   
  throw err;
  ^

Error: Cannot find module 'discord.js'
Require stack:
- C:\Users\netin\Desktop\bot\index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1029:15)       
    at Function.Module._load (internal/modules/cjs/loader.js:898:27)
    at Module.require (internal/modules/cjs/loader.js:1089:19)
    at require (internal/modules/cjs/helpers.js:73:18)
    at Object.<anonymous> (C:\Users\netin\Desktop\bot\index.js:1:17)
    at Module._compile (internal/modules/cjs/loader.js:1200:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
    at Module.load (internal/modules/cjs/loader.js:1049:32)
    at Function.Module._load (internal/modules/cjs/loader.js:937:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
 {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ 'C:\\Users\\netin\\Desktop\\bot\\index.js' ]
}

【问题讨论】:

  • 欢迎您!您需要粘贴一些代码片段,例如 c:\users\netin\desktop\index.js 中的内容,也可以用 javascript 标记它,以便 javascript 开发人员在粘贴一些代码片段后可以查看您拥有的内容。
  • 另外,请尝试再次在控制台中执行npm i discord.js

标签: discord discord.js


【解决方案1】:

请尝试安装 discord.js npm 包。

NPM

npm install discord.js

npm i discord.js

纱线

yarn add discord.js

有用的链接(参考)

https://discord.js.org/#/

https://www.npmjs.com/package/discord.js

https://github.com/discordjs/discord.js

【讨论】:

    【解决方案2】:

    你没有安装 discord.js

    NPM

    npm i discord.js
    

    纱线

    yarn add discord.js
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-03-28
      • 2021-11-16
      • 2021-10-19
      • 2021-07-13
      • 2019-07-19
      • 2020-07-26
      • 2020-08-29
      • 2018-11-19
      相关资源
      最近更新 更多