How do I resolve `Missing shims for Node.js built-ins` in an electron rollup app?

I’m trying to create a sqlite3 db using knex from inside an electron app built with rollup.

import knex from 'knex';
import 'sqlite3';

const database = knex({
    client: 'sqlite3',
    connection: {
        filename: './games.sqlite'
    },
    useNullAsDefault: true
});

database.schema.hasTable('games').then(exists => {
    if (!exists) {
        return database.schema.createTable('games', t => {
            t.increments('id').primary();
            t.string('name', 100);
        });
    }
});

export default database;

As soon as this code is run I see the following warnings:

(!) Missing shims for Node.js built-ins
Creating a browser bundle that depends on 'util', 'events', 'stream', 'assert', 'timers', 'url', 'path', 'os' and 'buffer'. You might need to include https://github.com/ionic-team/rollup-plugin-node-polyfills
LiveReload enabled
(!) Missing global variable names
Use output.globals to specify browser global variable names corresponding to external modules
util (guessing 'util$6')
events (guessing 'require$$0$1')
stream (guessing 'require$$1')
assert (guessing 'assert')
timers (guessing 'timers_1')
url (guessing 'url')
fs (guessing 'fs')
path (guessing 'path$1')
child_process (guessing 'require$$0$2')
os (guessing 'os')
buffer (guessing 'buffer')

My read of this is that knex and/or sqlite3 is using a bunch of node built-ins and rollup needs to know how to bundle those. The suggested rollup-plugin-node-polyfills plugin sounds like it has been deprecated a few times over and is now replaced by @rollup/plugin-inject, but I don’t understand what I’m supposed to do with it in my rollup.config.js.

My guess would be

 plugins: (
    inject({
      util: <<<<something>>>>,
      events: <<<<something>>>>
      etc etc
    })
  )

but none of my guesses for what those values should be have done much of anything.

rollup-plugin-node-polyfills also sounded promising but didn’t seem to work.

Linux header 4.9.0-11-amd64 is missing in debian

I am a software developer and have only a basic understanding about Linux systems. We are in a migration phase from GCP to AWS and found that the Linux headers are missing while installing Cloud endure agent.

On checking found that the version 4.9.0-11-amd64 is missing in debian repository. Is there any way to install the header version 4.9.0-11-amd64 ?

Any help would be highly appreciated.

linux – Openvas on Kali missing file

I’ve try to install Openvas on kali latest version but I’ve got some strange issue some of file are completely missing.

when I try to gvm-start I got this error
service: can’t open PID file /run/gvm/gvmd.pid (yet?) after start: Operation not permited

So I tought it was a permission problem so I try the dirty solution of chmod 777 on the file but i got the error “can’t access the file /run/gvm/gvmd.pid file does not exist”

Same for the file: openvas-manager.service and openvas-scanner.service

I try to reinstall openvas and restart I also try to restart docker but nothing work and nobody seem to have a proper solution for me

So any idea of what should I do.

netbsd – chroot not able to start service – not found. What is missing?

I would like to run a service inside a chroot in a NetBSD 9.1 amd64 system.
The service runs if invoked from OS.
The service in question is dendrite-monolith-server. I just copied the file for ease of use to start sitting inside the chroot in /bin/.

# ldd bin/start 
bin/start:
        -lpthread.1 => /usr/lib/libpthread.so.1
        -lc.12 => /usr/lib/libc.so.12

They are hard linked:

# ls -l usr/lib
total 8560
-r--r--r--  2 root  pe  2079984 Feb 22 23:40 lc.12
-r--r--r--  2 root  pe  2079984 Feb 22 23:40 libc.so.12
-r--r--r--  2 root  pe    93656 Feb 22 23:40 libpthread.so.1
-r--r--r--  2 root  pe    93656 Feb 22 23:40 lpthread.1

In the chroot /dev, did MAKEDEV all to create the devices.

Copied ld.elf_so to the chroot /libexec directory

# ls -l /libexec/
total 324
-r-xr-xr-x  1 0  1000  164344 Feb 22 23:47 ld.elf_so

ksh93 is statically linked:

# chroot ./ /bin/ksh93
#
# /bin/start 
/bin/ksh93: /bin/start: not found

What’s wrong or missing?

Missing unconfirmed transaction from trezor

https://btc4.trezor.io/tx/a23173e98ac492eb84c4324ce66817a6900d89c2fb408a85daf9ba98f1a7b513

Hello guys, I sent this transaction like every other time from trezor, the fee was set on high. But this time I cant even find it in any blockchain explorer by its ID and the btc did not come

schema.org – JSON-LD error: “Missing ‘}’ or object member name” even when parenthesis appear to be balanced

Your problem is smart quotes. You use them. JSON can’t have them. JSON has to have regular old dumb quotes. Up until line 10, you use the correct quotation marks, but then at line 10 you switch to using fancy slanted quotation marks.

The solution is to use find and replace to find the smart quotes and replace them with dumb quotes. I would also clean up the indentation. Then you end up with:

<script type="application/ld+json">
  {
    "@context": "https://schema.org",
    "@type": "WebPage",
    "name": "Brand X Information for Healthcare Professionals",
    "mainEntity": {
      "@type": "Drug",
      "name": "Name",
      "activeIngredient": "Cysteamine Hydrochloride",
      "administrationRoute": "Ophthalmic",
      "drugUnit": "0.44% Cysteamine Ophthalmic Solution",
      "dosageForm": "Topical Solution",
      "manufacturer": {
        "@type": "Organization",
        "name": "Company Name"
      },
      "mechanismOfAction": "Cysteamine, the active ingredient in BrandX, is an aminothiol that depletes lysosomal cystine, preventing buildup of cystine crystals in bodily tissues. Within lysosomes, cysteamine interacts with cystine to form cysteine and cysteineu2013cysteamine mixed disulfide. These substances can pass through the lysosomal membrane and be eliminated from the cell."
    }
  }
</script>

This is usually caused by trying to edit in a word processor such as Microsoft Word, Google docs, or Libreoffice. For code, you should avoid using these programs. Find a text editor built for programmers. Such an editor won’t try to smarten your quotes for you.

schema.org – Missing ‘}’ or object member name

Your problem is smart quotes. You use them. JSON can’t have them. JSON has to have regular old dumb quotes. Up until line 10, you use the correct quotation marks, but then at line 10 you switch to using fancy slanted quotation marks.

The solution is to use find and replace to find the smart quotes and replace them with dumb quotes. I would also clean up the indentation. Then you end up with:

<script type="application/ld+json">
  {
    "@context": "https://schema.org",
    "@type": "WebPage",
    "name": "Brand X Information for Healthcare Professionals",
    "mainEntity": {
      "@type": "Drug",
      "name": "Name",
      "activeIngredient": "Cysteamine Hydrochloride",
      "administrationRoute": "Ophthalmic",
      "drugUnit": "0.44% Cysteamine Ophthalmic Solution",
      "dosageForm": "Topical Solution",
      "manufacturer": {
        "@type": "Organization",
        "name": "Company Name"
      },
      "mechanismOfAction": "Cysteamine, the active ingredient in BrandX, is an aminothiol that depletes lysosomal cystine, preventing buildup of cystine crystals in bodily tissues. Within lysosomes, cysteamine interacts with cystine to form cysteine and cysteineu2013cysteamine mixed disulfide. These substances can pass through the lysosomal membrane and be eliminated from the cell."
    }
  }
</script>

This is usually caused by trying to edit in a word processor such as Microsoft Word, Google docs, or Libreoffice. For code, you should avoid using these programs. Find a programmers text editor that won’t try to smarten your quotes for you.

permissions – Add Members missing in Group Membership SharePoint online

Stack Exchange Network


Stack Exchange network consists of 176 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Screen Saver settings completely missing in Big Sur?

I am running macOS Big Sur Version 11.2.1 on a M1 Mac Mini.

When I try to access my screen saver settings in System Preferences > Desktop & Screen Saver > Screen Saver, I now get a blank window like so:

enter image description here

PHP upgrade fails because WordPress reports a missing MySQL extension

On a shared hosting, I have

  • WordPress version 5.6.1
  • PHP version 5.6.38

The WP dashboard recommends a PHP upgrade to 7.4 but when I do that, I get a blank error page saying “Your PHP installation appears to be missing the MySQL extension which is required by WordPress.” I tought MySQL was no longer needed with recent WP versions?

I already tried

  • deactivating all extensions
  • running PHP Compatibility Checker: all extensions are reported compatible with PHP 7.3

Any tips will be greatly appreciated. Thanks!