Modules that need to be compiled from pnpm

Hello, I was working with modules that need to compile from binaries between them:

  • uws (specific version: 10.148.1)
  • node-webcrypto-ossl
  • wrtc

These modules have as dependencies: node-pre-gyp, node-gyp, node-cmake … I’m not sure why pnpm does not have some modules or can not compile.

I had to use npm by activating it from the console (enable-npm) and of course, this takes a lot of disk quota space.

But when using npm I did not get errors … is there something that I did wrong or pnpm does not use modules compiled from binaries?

package.json (summary)

{
    "main": "index.js",
    "scripts": {
        "start": "node index.js"
    },
    "dependencies": {
        "jsonwebtoken": "^8.3.0",
        "node-webcrypto-ossl": "^1.0.38",
        "uws": "10.148.1",
        "wrtc": "^0.2.0"
    },
    "license": "MIT",
    "engines": {
        "node": "10.x",
        "npm": "6.x"
    },
    "private": true
}

Using this “package.json” in pnpm I have errors, when using with npm I need to add node-cmake as dependency to the top.

Let us know the project name and we’ll take a look. If your project is private, either make it public temporarily or DM me a join link so we can view the code. Thanks.

The project I referred to was imported from GitHub, but I exclude it. I started a new one by calling these modules in the expression template and I did not get any errors. I re-imported from GitHub and the errors persist.

imported from GitHub: https://glitch.com/~authchainjs-signaling

based on express model: https://glitch.com/~aspiring-herring

I tried importing https://github.com/node-webrtc/node-webrtc-examples

Which has wrtc in the package.json

And was getting similar errors like the following in the log:

.../wrtc/0.4.2/node_modules/wrtc install$ node scripts/download-prebuilt.js
.../wrtc/0.4.2/node_modules/wrtc install: internal/modules/cjs/loader.js:584
.../wrtc/0.4.2/node_modules/wrtc install:     throw err;
.../wrtc/0.4.2/node_modules/wrtc install:     ^
.../wrtc/0.4.2/node_modules/wrtc install: Error: Cannot find module '/rbd/pnpm-volume/rbd/pnpm-volume/f80e6a39-2237-4422-b451-1aeaa39a3873/node_modules/node-pre-gyp/bin/node-pre-gyp'
.../wrtc/0.4.2/node_modules/wrtc install:     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
.../wrtc/0.4.2/node_modules/wrtc install:     at Function.Module._load (internal/modules/cjs/loader.js:508:25)
.../wrtc/0.4.2/node_modules/wrtc install:     at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
.../wrtc/0.4.2/node_modules/wrtc install:     at startup (internal/bootstrap/node.js:283:19)
.../wrtc/0.4.2/node_modules/wrtc install:     at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
.../wrtc/0.4.2/node_modules/wrtc install: Failed
ERROR  wrtc@0.4.2 install: `node scripts/download-prebuilt.js`
Exit status 1
at Error: wrtc                                                                                                                                          
at <anonymous>  /opt/nvm/versions/node/v10.15.3/lib/node_modules/pnpm/lib/node_modules/@zkochan/npm-lifecycle/index.js:303     var er = new Error('Exit…
at emit         events.js:189                                                                                                                           
at <anonymous>  /opt/nvm/versions/node/v10.15.3/lib/node_modules/pnpm/lib/node_modules/@zkochan/npm-lifecycle/lib/spawn.js:55  cooked.emit('close', cod…
at emit         events.js:189                                                                                                                           
at maybeClose   internal/child_process.js:970                                                                                                           
at onexit       internal/child_process.js:259
internal/modules/cjs/loader.js:584
    throw err;
    ^
Error: Cannot find module '../build/Release/wrtc.node'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
    at Function.Module._load (internal/modules/cjs/loader.js:508:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/rbd/pnpm-volume/f80e6a39-2237-4422-b451-1aeaa39a3873/node_modules/.registry.npmjs.org/wrtc/0.4.2/node_modules/wrtc/lib/binding.js:6:20)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)

I tried the enable-npm command in the terminal and everything was able to install successfully!

Or I guess I should say that the npm install seems to proceed without failure, not 100% sure that the wrtc module ends up working correctly. The examples don’t seem to work on glitch yet from the github I cloned but are working locally.