简体   繁体   English

需要堆栈:\\\\ 我从未听说过的错误

[英]Require stack: \\ Error I've never heard of

throw err;抛出错误;
^ ^
Error: Cannot find module './C:\\Users\\domri\\OneDrive\\Desktop\\Repositories\\Discord Bot\\commands\\test/ping.js'错误:找不到模块 './C:\\Users\\domri\\OneDrive\\Desktop\\Repositories\\Discord Bot\\commands\\test/ping.js'

The error is found somewhere in here错误是在这里的某个地方发现的

const isDirectory = source => fs.lstatSync(source).isDirectory();
const getDirectories = source => fs.readdirSync(source).map(name => join(source, name)).filter(isDirectory);



getDirectories(__dirname + '/commands').forEach(category => {
  const commandFiles = fs.readdirSync(category).filter(file => file.endsWith('.js'));

  for (const file of commandFiles) {
    const command = require(`./${category}/${file}`);
    client.commands.set(command.name, command);
    if (command.aliases) {
      for (const alias of command.aliases) {
        client.aliases.set(alias, command.name);
      }
    }
  }
});

请发送控制台错误,或者检查您是否安装了使用的 npm,尝试npm inpm ci并且因为它是discord.js在执行npm inpm ci之前先尝试这个npm i discord.js

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 终端引用了我从未听说过的设备 - Terminal is referencing a device I've never heard of or seen 我听说全局变量不好,我应该使用什么替代解决方案? - I've Heard Global Variables Are Bad, What Alternative Solution Should I Use? 我一直在尝试创建一个 React 应用程序,但我一直收到此错误:“npm ERR!cb() 从未调用过!” - I've been trying to create a react app but I keep getting this error: "npm ERR! cb() never called!" 错误:$ injector:unpr未知提供程序DataServiceProvider(这是我从未声明过的东西) - Error: $injector:unpr Unknown Provider DataServiceProvider (which is something I've never declared) 我在需要堆栈的节点 js 中遇到错误 - I am getting a error in node js which is of Require Stack 奇怪的JavaScript语法我以前从未使用过,但它的工作原理 - Weird JavaScript syntax I've never used before, but it works JS ES6 类定义:Preact 主页上的示例:我从未见过这个 - JS ES6 class definition: Example on Preact homepage: I've never seen this 错误:找不到模块 './keys_dev' 需要堆栈 - Error: Cannot find module './keys_dev' Require stack 运行关于 Require Stack 的 ng 服务器时出错 - Angular 9 - Error while running ng server about Require Stack - Angular 9 错误:找不到模块“data.json”需要堆栈:-C: - Error: Cannot find module 'data.json' Require stack: - C:
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM