Error while trying to install keyv with root

So, I need to install a module with root access so that it will actually work.
So I tried to do

pnpm install keyv -g --force

And then I just got this error

ERROR EACCES: permission denied, unlink ‘/opt/nvm/versions/node/v10.15.3/pnpm-global/1_shamefully_flatten/node_modules/.modules.yaml’

I don’t really know why… Like, I need to install it with root access… Any way I could do that?

Hey @Aprixia we don’t allow root access, so I’m afraid there’s no way to do what you specifically asked.

What happens when you put keyv in your package.json? Can you tell us about what problems you run into? Nothin on the package’s NPM page seems to indicate that it won’t work without root as far as I can tell. They don’t even suggest installing with -g (which doesn’t mean anything in Glitch anyway).

I keep getting this error:

Keyv Connection Error: { [Error: SQLITE_CANTOPEN: unable to open database file] errno: 14, 
code: 'SQLITE_CANTOPEN' }

dev is not a command!

mod is not a command!

(node:180) UnhandledPromiseRejectionWarning: Error: SQLITE_CANTOPEN: unable to open database file

(node:180) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)

(node:180) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

The first error seems likely to be pointing to you code’s inability to find your SQLite database file, not anything related to not being able to install keyv, but it’s hard to know for sure without looking at the code. Same issue for the “not a command” errors - I have no idea where they’re coming from - are those being emitted by your own code?

Here is the code that I made that causes this error. It’s the same as on the djs guides.
const Keyv = require('keyv');
const keyv = new Keyv('sqlite://path/to/database.sqlite');

keyv.on('error', err => console.error('Keyv Connection Error:', err));

I’ve tried many different ways, but they all just give the error that they can’t open the file.

You need to update sqlite://path/to/database.sqlite to the actual path of the database in your project. Currently, it’s looking in a location that doesn’t exist, so it isn’t able to connect to the database. Let us know the project name and we can take a closer look. Thanks.

Alright
xnegnolustbot

Also while I am here,
I planned to post a thread about this, but I will just say it here.
So the new automatic close quote and () feature is great, I love it, but there is one issue… So example while writing a message and I am trying to get a quote in there by doing ', it just thinks I am done with the quotes, which then leaves me with something like message.reply('Hello, aren\'t you) which is really annoying when what I tried to achieve with the \ was to get message.reply('Hello, aren\'t you')

I’d recommend you trying to fix that by making it so that if someone put a backslash(\) and then put the ', it will not add either 2 of them or just jump to the end, instead it would just add 1 singular '.

Alright, thank you.

You’ve got a number of different database-looking files in there, so I’m not sure which one you’re trying to hook up to keyv. They all appear to be in the root directory, so if you’re trying to connect to database.sqlite then I think you want const keyv = new Keyv('sqlite://database.sqlite');.

Thanks for the note regarding auto-closing quotes. I’ve found that that behavior is pretty common in IDE-like components that auto-close things for you. That behavior in Glitch is provided by CodeMirror, and I don’t think we’ll be forking CodeMirror to address this any time soon. I agree it can be frustrating - what I typically do in situations like that is to use double-quotes around strings that contain single quotes, so I’d end up with message.reply("Hello, aren't you"). That might help you get around the annoyance here, unless there’s a reason that won’t work for you.

Well, yeah, the thing is just that my style has been to use singular quotes in programming and double quotes in my own messages when I am quoting something. So I’ve gotten it as a auto pilot to use ’ and ’ ’ in strings