1

I encounter this problem when am trying to install ganache-cli in my laptop (Kali Linux). The error that I came across is:

sudo npm install -g ganache-cli
npm ERR! code MODULE_NOT_FOUND
npm ERR! Cannot find module 'encoding'

The debug log:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'install', '-g', 'ganache-cli' ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session 8012bd73873770d8
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData error for ganache-cli@latest Cannot find module 'encoding'
8 verbose stack Error: Cannot find module 'encoding'
8 verbose stack     at Function.Module._resolveFilename (module.js:547:15)
8 verbose stack     at Function.Module._load (module.js:474:25)
8 verbose stack     at Module.require (module.js:596:17)
8 verbose stack     at require (internal/module.js:11:18)
8 verbose stack     at Object.<anonymous> (/usr/share/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/src/body.js:13:17)
8 verbose stack     at Module._compile (module.js:652:30)
8 verbose stack     at Object.Module._extensions..js (module.js:663:10)
8 verbose stack     at Module.load (module.js:565:32)
8 verbose stack     at tryModuleLoad (module.js:505:12)
8 verbose stack     at Function.Module._load (module.js:497:3)
8 verbose stack     at Module.require (module.js:596:17)
8 verbose stack     at require (internal/module.js:11:18)
8 verbose stack     at Object.<anonymous> (/usr/share/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/src/index.js:15:14)
8 verbose stack     at Module._compile (module.js:652:30)
8 verbose stack     at Object.Module._extensions..js (module.js:663:10)
8 verbose stack     at Module.load (module.js:565:32)
9 verbose cwd /home/shirke
10 verbose Linux 4.15.0-kali2-amd64
11 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "ganache-cli"
12 verbose node v8.11.2
13 verbose npm  v5.8.0
14 error code MODULE_NOT_FOUND
15 error Cannot find module 'encoding'
16 verbose exit [ 1, true ]

This error is bugging me a lot as am not able to do any work.

1
  • Hi Welcome to SO. You need to manually install encoding using following command npm install encoding Commented Sep 21, 2018 at 16:41

1 Answer 1

1

Welcome to SO.

You need to manually install encoding using below command to make it work

npm install encoding
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.