Error: Cannot find module 'chalk'
See original GitHub issueDescription 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
- Go to Website
- Click Website Theme
- Click Add Website Theme
- Enter a name, e.g. ‘Test’
- Click Save
Observed result
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:
- Created a year ago
- Comments:12
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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
Follow https://github.com/frappe/frappe_docker/issues/919