question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Cannot find module 'chalk'

See original GitHub issue

Description of the issue

With ERPNext v14 I’m not able to create a new Website Theme. I’ve tested Versions up to 14.0.3.

Context information (for bug reports)

Installation of the test environment:

git clone https://github.com/frappe/frappe_docker
cd frappe_docker
cp example.env .env
mkdir ~/gitops
docker compose -f compose.yaml \
  -f overrides/compose.noproxy.yaml \
  -f overrides/compose.erpnext.yaml \
  -f overrides/compose.mariadb.yaml \
  -f overrides/compose.redis.yaml \
  config > ~/gitops/docker-compose.yml

docker compose --project-name example -f ~/gitops/docker-compose.yml up -d
docker exec example-backend-1 bench new-site localhost --mariadb-root-password 123 --admin-password secret --install-app erpnext

Steps to reproduce the issue

  1. Go to Website
  2. Click Website Theme
  3. Click Add Website Theme
  4. Enter a name, e.g. ‘Test’
  5. Click Save

Observed result

Cannot find module chalk

Expected result

New Website Theme without errors.

Stacktrace / full error message if available

Error: Cannot find module 'chalk'
Require stack:
- /home/frappe/frappe-bench/apps/frappe/esbuild/utils.js
- /home/frappe/frappe-bench/apps/frappe/esbuild/sass_options.js
- /home/frappe/frappe-bench/apps/frappe/generate_bootstrap_theme.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
at Function.Module._load (internal/modules/cjs/loader.js:746:27)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:101:18)
at Object. (/home/frappe/frappe-bench/apps/frappe/esbuild/utils.js:3:15)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/frappe/frappe-bench/apps/frappe/esbuild/utils.js',
'/home/frappe/frappe-bench/apps/frappe/esbuild/sass_options.js',
'/home/frappe/frappe-bench/apps/frappe/generate_bootstrap_theme.js'
]
}

Someone solved this issue in this post by doing

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

However as far as I know this has to be done when creating the image.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:12

github_iconTop GitHub Comments

1reaction
revantcommented, Sep 8, 2022

can you try building the assets image like this? https://github.com/frappe/frappe_docker/issues/919#issuecomment-1239305640

I think solved it for me. If that works, I’ll remove frappe/assets-builder and update documentation to build assets using frappe/bench

0reactions
revantcommented, Sep 10, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot find module 'chalk' #13 - addyosmani/a11y - GitHub
I installed the module npm install -g a11y and it installed without issue. ... I tried running npm cache clean which I found...
Read more >
react native - Cannot find module node_modules\chalk\source ...
Please verify that the package.json has a valid "main" entry Error : Cannot find module 'C:\Users\xyz\projects\abc\node_modules\chalk\source' ...
Read more >
Chalk - npm
Start using chalk in your project by running `npm i chalk`. There are 89959 other projects in the npm registry using chalk.
Read more >
Error: Cannot find module 'chalk' - ERPNext Forum
I have this error log ------------------------- Please install yarn using below command and try again. npm install -g yarn > frappe@ ...
Read more >
chalk Error [ERR_REQUIRE_ESM]: require() of ES Module not ...
The chalk error "[ERR_REQUIRE_ESM]: require() of ES Module not supported" occurs because the chalk package has been converted to be an ESM only...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found