Author

Topic: ganache-cli module is not found (Read 100 times)

newbie
Activity: 1
Merit: 0
September 18, 2018, 03:12:39 PM
#2
For anyone else that finds this thread it's something to do with the save option when installing the ganache-cli library

`npm install --save solc ganache-cli web3 mocha`

Rerunning this allowed mocha to connect to ganache.
jr. member
Activity: 113
Merit: 5
March 14, 2018, 06:50:20 AM
#1
I want to run a test program on ethereum code. i have installed ganache-cli. However, i could not run the test. The error is shown as below.

viiic@ubuntu:~/Downloads/project/inbox$ sudo npm install -g ganache-cli
npm WARN deprecated [email protected]: 🙌  Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
npm WARN deprecated [email protected]: Package no longer supported. Contact [email protected] for more info.
/usr/bin/ganache-cli -> /usr/lib/node_modules/ganache-cli/build/cli.node.js
npm WARN [email protected] requires a peer of webpack@^4.0.0 but none is installed. You must install peer dependencies yourself.

+ [email protected]
updated 2 packages in 10.897s

viiic@ubuntu:~/Downloads/project/inbox$ sudo npm run test

> [email protected] test /home/vic/Downloads/project/inbox
> mocha

module.js:540
    throw err;
    ^

Error: Cannot find module 'ganache-cli'
    at Function.Module._resolveFilename (module.js:538:15)
    at Function.Module._load (module.js:468:25)
    at Module.require (module.js:587:17)
    at require (internal/module.js:11:18)
    at Object. (/home/vic/Downloads/project/inbox/test/Inbox.test.js:2:18)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
    at Module.require (module.js:587:17)
    at require (internal/module.js:11:18)
    at /home/vic/Downloads/project/inbox/node_modules/mocha/lib/mocha.js:231:27
    at Array.forEach ()
    at Mocha.loadFiles (/home/vic/Downloads/project/inbox/node_modules/mocha/lib/mocha.js:228:14)
    at Mocha.run (/home/vic/Downloads/project/inbox/node_modules/mocha/lib/mocha.js:536:10)
    at Object. (/home/vic/Downloads/project/inbox/node_modules/mocha/bin/_mocha:582:18)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
    at Function.Module.runMain (module.js:684:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] test: `mocha`
npm ERR! Exit status 1
Jump to: