Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module not found: Error: Can't resolve 'websocket' in web3c.js/node_modules/web3-providers-ws/src #93

Open
marsrobertson opened this issue Dec 15, 2018 · 3 comments

Comments

@marsrobertson
Copy link

  • git clone
  • npm install
  • npm run-script build
> [email protected] build /Users/zen/Code/web3c.js
> webpack-command --entry ./index.browser.js --output output/web3c.js

ℹ 「webpack」: Starting Build
ℹ 「webpack」: Build Finished

webpack v4.26.0

f426ec53caa9eb018dd4
 size     name  module                            status
 202 B    2     ./index.browser.js                built
 1.88 kB  3     ./web3c/index.js                  built
 3.54 kB  4     ./web3c/confidential.js           built
 8.42 kB  5     ./web3c/confidential_provider.js  built
 7.29 kB  6     ./web3c/key_manager.js            built
 15 B     7     crypto (ignored)                  built
 1.21 kB  8     ./crypto/subtle/mrae_box.js       built
 3.48 kB  9     ./crypto/subtle/siv_ctr.js        built
 489 B    14    (webpack)/buildin/global.js       built
 497 B    24    (webpack)/buildin/module.js       built
 15 B     149   util (ignored)                    built
 15 B     151   util (ignored)                    built
 15 B     176   buffer (ignored)                  optional built
 15 B     221   crypto (ignored)                  optional built

 Δt 4594ms (6 assets, 281 modules hidden)


./node_modules/web3-providers-ws/src/index.js
 0:0  error  Module not found: Error: Can't resolve 'websocket' in
             '/Users/zen/Code/web3c.js/node_modules/web3-providers-ws/src'

✖ 1 problem (1 error, 0 warnings)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `webpack-command --entry ./index.browser.js --output output/web3c.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.```
@willscott
Copy link
Contributor

it looks like the issue here is that websocket failed to build during npm install.

I see

[email protected][email protected] (git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2)

the websocket module does have a native code component that needs to compile with node-gyp:

> [email protected] install ~/web3c/node_modules/websocket
> (node-gyp rebuild 2> builderror.log) || (exit 0)

  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
  SOLINK_MODULE(target) Release/bufferutil.node
  CXX(target) Release/obj.target/validation/src/validation.o
  SOLINK_MODULE(target) Release/validation.node

Do you see errors there?

@jainsuchita
Copy link

My issue got resolved when I installed new version of web3

@mjgallag
Copy link

@willscott see issue web3/web3.js#2863 (comment) and associated commit web3/web3.js@b27eff4 for the fix. Upgrading the following web3 dependency to v1.0.0-beta.52 or higher should resolve this issue.

"web3": "1.0.0-beta.37",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants