找不到Browserify捆绑错误模块'xmlhttprequest'

时间:2019-01-04 22:04:09

标签: javascript browserify

这是我第一次使用Browserify。我尝试运行以下命令来捆绑所有要求:

browserify app.js -o bundle.js

我收到以下错误:

Error: module not found: "xmlhttprequest" from file /Users/macuser/Documents/Blockchain/Dev/Ethereum/hello-world/node_modules/ethers/utils/web.js
    at onresolve (/usr/local/lib/node_modules/browserify/node_modules/module-deps/index.js:182:30)
    at /usr/local/lib/node_modules/browserify/index.js:530:20
    at /usr/local/lib/node_modules/browserify/node_modules/browser-resolve/index.js:247:21
    at /usr/local/lib/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:55:18
    at load (/usr/local/lib/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:69:43)
    at onex (/usr/local/lib/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:92:31)
    at /usr/local/lib/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:22:47
    at FSReqWrap.oncomplete (fs.js:152:21)

我的app.js不需要xmlhttprequest,因此它必须依赖于其他一些依赖关系。

我尝试使用npm安装xmlhttprequest,但仍然出现相同的错误。我不确定如何解决。

0 个答案:

没有答案