Logs keeps showing "Error: Cannot find module 'yn'"

Hi
As the title shows, I keep getting “Error: Cannot find module ‘yn’” error in my logs.
I do not use the module nor could I find any reference to the module in my code.

I tried to “refresh” the service (calling refresh in the console) and it did not help.

What can I do?
thanks.

Try installing the module - npm i yn

1 Like

Hi thanks!
Before I had the chance to test your answer I started receiving

Error: Cannot find module ‘/rbd/pnpm-volume/0d3d9672-7144-4de2-9253-7431568ba34b/node_modules/ts-node/dist/bin.js’ :expressionless:

By the way, I also rewinded the code to a snapshot I am sure was working…
I still get these weird problems.

npm i yn

try that!!!

try that!!!

ok ok

TL;DR now it’s working, but it seems it fixed itself.

I tried npm i yn and received:

npm ERR! Error: EACCES: permission denied, open ‘/app/node_modules/@slack/events-api/node_modules/@types/debug/npm-shrinkwrap.json’

  • I enabled pnpm (I found a similar post in the forums).
    It wrote

restarting…

  • My service seemed running but my bot couldn’t contact with the service.

  • I refreshed again and my service was up but I started getting permission errors in runtime.

  • And then it fixed itself.

I would aprreciate understanding the reason for first error, I had no changes in my code.

you could’ve done this to remove the error before but DO NOT DO IT NOW:

rm -rf node_modules

Thanks, guys!

4 Likes

From now on, you may want to install packages using pnpm instead of npm as npm has not been working on some projects recently. They have the same commands, just different ways of installing packages.

So, this:

npm install lodash

would become this:

pnpm install lodash
2 Likes