Bitcoin Forum
November 12, 2024, 06:19:22 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: ganache-cli module is not found  (Read 100 times)
victorkimba17 (OP)
Jr. Member
*
Offline Offline

Activity: 113
Merit: 5


View Profile
March 14, 2018, 11: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 babel-preset-es2015@6.24.1: 🙌  Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
npm WARN deprecated nomnom@1.8.1: Package no longer supported. Contact support@npmjs.com for more info.
/usr/bin/ganache-cli -> /usr/lib/node_modules/ganache-cli/build/cli.node.js
npm WARN webpack-cli@2.0.12 requires a peer of webpack@^4.0.0 but none is installed. You must install peer dependencies yourself.

+ ganache-cli@6.1.0
updated 2 packages in 10.897s

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

> inbox@1.0.0 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.<anonymous> (/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 (<anonymous>)
    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.<anonymous> (/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! inbox@1.0.0 test: `mocha`
npm ERR! Exit status 1
scottrepreneur
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
September 18, 2018, 08: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.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!