Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not find module in "./utils/index" #83

Open
Reboot-Codes opened this issue Jun 28, 2021 · 7 comments
Open

Can not find module in "./utils/index" #83

Reboot-Codes opened this issue Jun 28, 2021 · 7 comments

Comments

@Reboot-Codes
Copy link

After another problem where the cli couldn't find the node parser (had to make a custom script for it) the slappey cli can't find any module(s) inside of the ./utils/index file.

Error output below without any arguments or flags passed in:

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

Error: Cannot find module './utils/index'
Require stack:
- /Users/reboot/[stdin]
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at [stdin]:14:17
    at Script.runInThisContext (vm.js:134:12)
    at Object.runInThisContext (vm.js:311:38)
    at internal/process/execution.js:77:19
    at [stdin]-wrapper:6:22
    at evalScript (internal/process/execution.js:76:60) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/Users/reboot/[stdin]' ]
}

I assume it's looking for exports from the [path to slappey source code]/src/utils/index.ts file.

@Reboot-Codes
Copy link
Author

I also forgot to mention, here is some details that should be useful:

  • Running on an M1 Mac
  • Slappey was installed globally with Yarn
  • Yarn was installed using a native Homebrew installation

@TheRamann
Copy link

Maybe you should try reinstalling npm files
I always do the same when i get error and it always works

@Reboot-Codes
Copy link
Author

Reinstalling the node_modules directory where the source code is?

@Peter-MJ-Parker
Copy link

Actually, it looks like its trying to pull your main file <index.ts>/<index.js> from your home directory instead of your bot project.
Create a new folder and cd into it in terminal and try running again.

@Reboot-Codes
Copy link
Author

Reboot-Codes commented Oct 14, 2021

Nope, running it directly from /opt/homebrew/bin/slappey and the custom script don't work, and using the slappey command that uses the homebrew bin file. But hey, a new problem! (yayn't):

env: node\r: No such file or directory

This is even more confusing, as it seems like it can't use node, which shouldn't be a problem as node is in my path (version managed using n).

@Reboot-Codes
Copy link
Author

Maybe you should try reinstalling npm files I always do the same when i get error and it always works

One problem, I don't know which "npm files" you're talking about. As 1) i'm using yarn, and 2) do you want me to reinstall yarn or reinstall slappey?

@Peter-MJ-Parker
Copy link

Reinstall using yarn. Yarn remove slappey, yarn global add slappey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants