Error Installing Stuff

Need help, getting this error:

module.js:550

throw err;

^


Error: Cannot find module 'snekfetch'

at Function.Module._resolveFilename (module.js:548:15)

at Function.Module._load (module.js:475:25)

at Module.require (module.js:597:17)

at require (internal/module.js:11:18)

at Object.<anonymous> (/rbd/pnpm-volume/61d4c8b6-b74c-4975-98c9-3bbdb26f2e5b/node_modules/.registry.npmjs.org/discord.js/11.4.2/node_modules/discord.js/src/util/Util.js:1:81)

at Module._compile (module.js:653:30)

at Object.Module._extensions..js (module.js:664:10)

at Module.load (module.js:566:32)

at tryModuleLoad (module.js:506:12)

at Function.Module._load (module.js:498:3)

which is weird because I don’t use snekfetch, niether is it a dependency for anything I use. Regardless, I try to install snekfetch to just get it over with, but I’m met with this error:

$ npm i snekfetch
npm WARN deprecated snekfetch@4.0.4: use node-fetch instead
npm ERR! path /app/node_modules/tar/npm-shrinkwrap.json
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall open
npm ERR! Error: EACCES: permission denied, open '/app/node_modules/tar/npm-shrinkwrap.json'
npm ERR!  { Error: EACCES: permission denied, open '/app/node_modules/tar/npm-shrinkwrap.json'
npm ERR!   cause: 
npm ERR!    { Error: EACCES: permission denied, open '/app/node_modules/tar/npm-shrinkwrap.json'
npm ERR!      errno: -13,
npm ERR!      code: 'EACCES',
npm ERR!      syscall: 'open',
npm ERR!      path: '/app/node_modules/tar/npm-shrinkwrap.json' },
npm ERR!   isOperational: true,
npm ERR!   stack: 'Error: EACCES: permission denied, open \'/app/node_modules/tar/npm-shrinkwrap.json\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'open',
npm ERR!   path: '/app/node_modules/tar/npm-shrinkwrap.json',
npm ERR!   parent: 'better-sqlite3' }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).

npm ERR! A complete log of this run can be found in:
npm ERR!     /tmp/npm-cache/8.15.1/_logs/2019-06-18T05_11_42_352Z-debug.log

basically I’m unable to install anything with npm now, not sure why. Seems to be a permissions issue, and I can’t solve it myself, so help would be appreciated.

Project: yt-maxmask-0404-s-bot

Having this issue with another thing as well, asking for merge-descriptors although I don’t use it, and I’m unable to install it back.
Project name is Azuki

reinstall the module.
I get this error a lot too on one of my projects.

Whenever you get the error Error: Cannot find module ‘name of the module’ go into the console and just run pnpm install module and then refresh
So in this case, for you, it would be pnpm install snekfetch and then refresh

Keep in mind that the issue might have another module like that too, so if you run the pnpm install and you still have the error text showing up, go back to the logs and check which module it is and then install that too.
You kind of don’t have to refresh through the console all the time, but I find it useful.

Hey @Cyberbullie, discord.js depends upon snekfetch as you can see in the Dependencies tab at https://www.npmjs.com/package/discord.js. Likewise for your other project, express depends upon merge-descriptors as noted at https://www.npmjs.com/browse/depended/merge-descriptors.

In each of those cases if you run into installation problems, running enable-pnpm in the console often solves the issue without resorting to manually installing the packages.

I understand the errors got dependencies, the issue is installing them. Please look at the error at the bottom, I lack permission to make any changes.

Hey @Cyberbullie I went into the ~azuki project you mentioned and executed enable-pnpm from the project’s console as I noted above. That seems to have resolved the issue. You could have done the same thing - the container user that’s logged into the console is the same no matter who accesses it.

There may be a permissions issue that’s preventing this particular install for some reason. enable-pnpm will abort this install and start a new one that often completes successfully. If that doesn’t happen we’ll have to take a closer look. If you try that on your other project, let us know what you see in response to that console command.

enable-pnpm worked, thanks

1 Like