Error: Cannot find module 'chalk'

I have this error log

-------------------------
Please install yarn using below command and try again.
npm install -g yarn

> frappe@ production /home/frappe/frappe-bench/apps/frappe
> FRAPPE_ENV=production node rollup/build.js

internal/modules/cjs/loader.js:613
    throw err;
    ^

Error: Cannot find module 'chalk'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:611:15)
    at Function.Module._load (internal/modules/cjs/loader.js:537:25)
    at Module.require (internal/modules/cjs/loader.js:665:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/home/frappe/frappe-bench/apps/frappe/rollup/build.js:3:15)
    at Module._compile (internal/modules/cjs/loader.js:736:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:747:10)
    at Module.load (internal/modules/cjs/loader.js:628:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:568:12)
    at Function.Module._load (internal/modules/cjs/loader.js:560:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! frappe@ production: `FRAPPE_ENV=production node rollup/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the frappe@ production script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/frappe/.npm/_logs/2019-01-25T10_24_03_311Z-debug.log
INFO:bench.utils:setting up backups
INFO:bench.utils:setting up auto update
Bench frappe-bench initialized
[frappe@svr1 ~]$
-------------------------

What happen and what should I do?

Many Thanks,
jgun

1 Like

Execute following commands:

Step 1: bench setup socketio
Step 2: bench setup requirements

6 Likes

Thanks @navdeepghai , I resolved the issue of Error: Cannot find module ‘chalk’ by running the command

Step 1: bench setup socketio
Step 2: bench setup requirements

1 Like