ubuntu: npm rebuild error after node update

After updating my node version from 10 to 12, it is impossible to use the npm rebuild option recommended by the application.
As I have seen in several publications, I tried to purge and reinstall the node: it failed. If you want to see what files I deleted, you can check the commented lines in my loaded txt:
In fact, I have a node -v: 10.12.0
and an npm -v: 6.4.1

Even after this, I still have the following error:

root@xxxx-VirtualBox:/home/xxxx/Desktop/opencti# npm rebuild

> core-js@3.1.4 postinstall /home/xxxx/Desktop/opencti/node_modules/core-js
> node scripts/postinstall || echo "ignore"

    throw err;

Error: Cannot find module '/home/xxxx/Desktop/opencti/node_modules/core-js/scripts/postinstall'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:772:15)
    at Function.Module._load (internal/modules/cjs/loader.js:677:27)
    at Function.Module.runMain (internal/modules/cjs/loader.js:999:10)
    at internal/main/run_main_module.js:17:11 {
  requireStack: ()

> protobufjs@6.8.8 postinstall /home/xxxx/Desktop/opencti/node_modules/apollo-engine-reporting-protobuf/node_modules/protobufjs
> node scripts/postinstall

    throw err;

Error: Cannot find module '/home/xxxx/Desktop/opencti/node_modules/apollo-engine-reporting-protobuf/node_modules/protobufjs/scripts/postinstall'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:772:15)
    at Function.Module._load (internal/modules/cjs/loader.js:677:27)
    at Function.Module.runMain (internal/modules/cjs/loader.js:999:10)
    at internal/main/run_main_module.js:17:11 {
  requireStack: ()
npm ERR! errno 1
npm ERR! protobufjs@6.8.8 postinstall: `node scripts/postinstall`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the protobufjs@6.8.8 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-09-15T06_03_57_920Z-debug.log

8 – How to extend a specific node type form?

I'm looking for a way to overwrite the NodeForm to get one class per package.

Really EntityForm manages the form for all entities.
NodeForm It extends and manages the forms for all nodes.

I wrote a CustomNodeForm replacing NodeForm behavior for all nodes.

 * Implements hook_entity_type_build().
function ftvisi_main_entity_type_build(array &$entity_types) {
  $entity_types('node')->setFormClass('default', CustomNodeForm::class);

Now I would like to get one class per package extending that CustomNodeForm but I feel that I can't do it.

CustomNodeForm I could create an instance of a form for each package, but I don't like that approach and we still have a single constructor that can generate problems like:

"OK, my first package needs this service, and my second package needs another, should I inject the entire container and then use the services on the fly?" => Very bad idea, I know.

Anyway, yes CustomNodeForm create instances of other classes themselves, it will be difficult to make fun and try. So I definitely don't like that approach.

Then I thought about using the form modes, but the same problem: a form mode can be used on any type of node, so we still don't have one class per package and we still have only one constructor for all the forms that use that form mode.

Any ideas to help?

full node: Bitcoin API standard

I am trying to implement a complete bitcoin node while learning a new programming language, but I cannot find the complete set of public APIs that the entire node has to expose. I guess the standard will be the core of bitcoin, but again the closest I can get is https://bitcoin.org/en/developer-reference. Where should I start?


I need to pass two parameters. The DNI (with which the user registered and the id of the candidate he voted for.

The desired route would be as for example:

http: // localhost: 3000 / api / DNI / ID-CANDIDATE

Here generate the form that will send these two data.
Try sending the candidate ID and it's perfect. I would be unable to send the DNI parameter with which the user logged in. I had planned to capture it from the session data but I don't know how and if it is the most convenient.

                <% locals.candidatos.forEach((item) => { %>

  • <%= item.nombreApellido %>

    <%= item.partido %>

  • <% }); %>

    From the API I want to work it this way since after receiving the POST data, on the one hand I increase the vote to the chosen candidate by 1 and on the other I modify the Boolean (default to false) to make it true. And so use it to check if X user has already voted.

    routerApi.post('/:id', function(req, res, next) {
        if (req.params.id) {
            Candidato.update({ _id: req.params.id }, { $inc: { votos: 1 } }, { safe: true },
                function(err, response) {
                    if (err) return res.status(500).send(error);
                    if (response) {
                        User.updateOne({ dni: req.session.user.dni }, { $set: { voto: true } }, { safe: true },
                            function(err, response) {
                                if (err) return res.status(500).send(error);
                                if (response) {
                                    console.log('Voto exitoso!')
                    } else {
                        res.status(500).send(new Error("No se pudo votar"));

    Thanks in advance. Regards

    linux – GlusterFS multiple bricks replicating in a single node

    The situation in question is that I have a raid of 4x2tb (1 brick), which I will make a backup in an external USB cabinet (1 brick). I hope GlusterFS allows me to replicate the main brick of my foray into my external usb brick on the same node. Over time I plan to migrate to a Raspi and relocate it, but I want to familiarize myself with its operation and have the basic work already in operation. Gluster sounds great, and I hope I can do this even though all the places I've searched seemed to have to have multiple nodes.

    Access House node complete with Python

    I have a complete Casa node running and I want to access my node in Python, how can I retrieve blockchain information?

    data structures: storing the height of an AVL tree node in constant time

    Starting at 9:00 at this conference, https://www.youtube.com/watch?v=FNeL18KsWPc&t=540s Erik Demaine talks about calculating the height of a node in an AVL tree in terms of doing an operation local constant time in your children Then continue talking about a general theorem for this pattern that would allow you to store the height in constant time.

    1) If you know what Erik is talking about, how is the height stored in constant time?

    2) In a related question, someone asked how to calculate the height of AVL in the most efficient way possible (Calculate the height of the AVL tree in the most efficient way possible). All responses except one agreed that the best possible way is in $ O ( lg n) $, but that is not constant time. The only answer that suggested storing the height was discarded. Could anyone explain why?

    node.js: problem starting the pm2 node process manager in aws elastic beanstalk, npm update verification failed

    I am trying to use pm2 for the process management of my typed node application, which has been implemented in elasticbeanstalk.

    Every time pm2 launches a new instance, I get this in the logs

    ——————— node.js records ————————- —

    pm2 start pm2.yaml

    (PM2) Spawning PM2 daemon with pm2_home=/tmp/.pm2
    (PM2) PM2 Successfully daemonized
    (PM2)(WARN) Applications server not running, starting...
    (PM2) App (server) launched (1 instances)

    Use pm2 show to get more details about an app

    npm update check failed
    Try running with sudo or get access
    to the local update config store via
    sudo chown -R $USER:$(id -gn $USER) /tmp/.config


    Every time you try to restart the application and launch another instance, it eventually ends the application degradation.

    I tried to use the command it suggests but it was in vain.

    Any help will be greatly appreciated. 🙂

    bitcoin core: Creating P2SH address is not the same as the address stored in the rpc node

    I have a private key and I try to create a P2SH address in testnet as my created node, but they are not the same. Please help me a little, thank you very much.

    Private key: c5964e19634e473e9c8fed3b149c4d44b6d62d62724035aad3eb911a1495ae27

    P2SH address from 1 threshold and 1 pubkey:

    P2WPKH Address: 2NGA8uGdnaQ21phNpVyV5uye5cbUtudxBWh || tb1qld2fzw9gj30wxjamsz73fug62das7cyq0em4mn

    Node Address: 2N8qKVKuR3QAy2cA5fF2QbuCpBGfGCmbUHx

    Here are more details of getaddressinfo:

        "result": {
            "address": "2N8qKVKuR3QAy2cA5fF2QbuCpBGfGCmbUHx",
            "scriptPubKey": "a914aafc9f09b99cbb1ba46001ec4868ba4fb32543ca87",
            "ismine": true,
            "solvable": true,
            "desc": "sh(wpkh((a1696bdc/0'/0'/375509')02a7065a210c28d27a591e55ac6be092111349fc4b23927bb4d13c46a683bcfff7))#hrgzj3gs",
            "iswatchonly": false,
            "isscript": true,
            "iswitness": false,
            "script": "witness_v0_keyhash",
            "hex": "00146da71bc5de0c0b59bbf73520df7e7d4048d02594",
            "pubkey": "02a7065a210c28d27a591e55ac6be092111349fc4b23927bb4d13c46a683bcfff7",
            "embedded": {
                "isscript": false,
                "iswitness": true,
                "witness_version": 0,
                "witness_program": "6da71bc5de0c0b59bbf73520df7e7d4048d02594",
                "pubkey": "02a7065a210c28d27a591e55ac6be092111349fc4b23927bb4d13c46a683bcfff7",
                "address": "tb1qdkn3h3w7ps94nwlhx5sd7lnagpydqfv5pyqurf",
                "scriptPubKey": "00146da71bc5de0c0b59bbf73520df7e7d4048d02594"
            "label": "test",
            "ischange": false,
            "timestamp": 1561438016,
            "hdkeypath": "m/0'/0'/375509'",
            "hdseedid": "e2e9dd17501f967b789c28c4be1dbf64897ad8d2",
            "hdmasterfingerprint": "a1696bdc",
            "labels": (
                    "name": "test",
                    "purpose": "receive"
        "error": null,
        "id": 1

    Complexity of time – Algorithm 1 Remove node vk from graph G represented as an adjacency matrix A

    The function accepts an adjacency matrix A, which represents a graph G, and an integer k, and returns an adjacency matrix A representing the graph G which is the result of eliminating the k-th node vk of G.

    Question: Provide an implementation, in pseudocode, of the NodeRemoval function. Give time the complexity of its implementation. Is it the best possible complexity for this task? Briefly describe your reasoning

    Consider the following: Algorithm 1 Remove node vk from graph G represented as an adjacency matrix A

    Require: A ∈ {0, 1} (power) n × n, k ∈ N, k ≤ n

    Make sure: A 0 ∈ {0, 1} (power) (n – 1) × (n – 1)

    1: NodeRemoval function (A, k)

    two:. . .

    3: return A

    4: final function