openethereum / pwasm-tutorial

A step-by-step tutorial on how to write contracts in Wasm for Kovan
GNU General Public License v3.0
229 stars 34 forks source link

Tutorial can't be passed from scratch #8

Closed NikVolf closed 6 years ago

NikVolf commented 6 years ago
Error: Cannot find module 'web3'
    at Function.Module._resolveFilename (module.js:536:15)
    at Function.Module._load (module.js:466:25)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/admin/git/pwasm-tutorial/deploy.js:1:74)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
ronitshar commented 6 years ago

I believe you have to install the web3 package globally with npm install -g web3

NikVolf commented 6 years ago

Aye, did it but still get this error

ronitshar commented 6 years ago

Maybe you can try adding it locally as well?

lexfrl commented 6 years ago

just tried. npm install -g web3 works for me..

chevdor commented 6 years ago

Also having issues. The building part is smooth. When it comes to deploying, I solved the missing web3 problem by installing it locally (no need for web3 globally):

npm init
npm i --save-dev web3 

That allows passing the web3 issue mentioned in this issue.

lexfrl commented 6 years ago

I've added package.json to the repo, so now it's possible to run npm install and use the local web3.js