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.0updated 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