0
Error: Cannot find module 'web3'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (F:\tuffle\toke.test.js:3:14)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at C:\Users\user\AppData\Roaming\npm\node_modules\truffle\node_modules\mocha\lib\mocha.js:250:27
    at Array.forEach (<anonymous>)
    at Mocha.loadFiles (C:\Users\user\AppData\Roaming\npm\node_modules\truffle\node_modules\mocha\lib\mocha.js:247:14)
    at Mocha.run (C:\Users\user\AppData\Roaming\npm\node_modules\truffle\node_modules\mocha\lib\mocha.js:576:10)
    at resolve (C:\Users\user\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-core\lib\test.js:116:1)
    at new Promise (<anonymous>)
    at Object.run (C:\Users\user\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-core\lib\test.js:115:1)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Truffle v5.0.33 (core: 5.0.33) Node v10.15.0

  • Do you have node_modules folder in your project directory? – Prachi Sharma Aug 24 at 3:53
3

Execute in console:

npm install web3

Make sure that the node_modules folder is in your project directory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.