Error: Cannot find module '../build/Release/wrtc.node'

316 views Asked by At

I`m a student and I facing such bug when I try webtorrent on nodejs on windows10.

Error: Cannot find module '../build/Release/wrtc.node'
Require stack:
- E:\node\hls\node_modules\wrtc\lib\binding.js
- E:\node\hls\node_modules\wrtc\lib\index.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (E:\node\hls\node_modules\wrtc\lib\binding.js:6:20)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'E:\\node\\hls\\node_modules\\wrtc\\lib\\binding.js',
    'E:\\node\\hls\\node_modules\\wrtc\\lib\\index.js'
  ]
}

Same error on both local insatll and global install. I checked the path, it is ok.

1

There are 1 answers

0
kou On

Since the problem is all about wrtc modle, I download the wrtc modle through npm and build it. After I built it successfully I replace the oingianl node_modules by the wrtc`s.