Try ERPNext Buy Support Partners Foundation

Error: Cannot find module 'graphlib

Error: Cannot find module ‘graphlib’
Require stack:

  • /home/frappe/frappe-bench/apps/frappe/node_modules/snyk/node_modules/@snyk/dep-graph/dist/core/create-from-json.js
  • /home/frappe/frappe-bench/apps/frappe/node_modules/snyk/node_modules/@snyk/dep-graph/dist/index.js
  • /home/frappe/frappe-bench/apps/frappe/node_modules/snyk/dist/lib/snyk-test/run-test.js
  • /home/frappe/frappe-bench/apps/frappe/node_modules/snyk/dist/lib/snyk-test/index.js
  • /home/frappe/frappe-bench/apps/frappe/node_modules/snyk/dist/lib/index.js
  • /home/frappe/frappe-bench/apps/frappe/node_modules/snyk/dist/lib/analytics.js
  • /home/frappe/frappe-bench/apps/frappe/node_modules/snyk/dist/cli/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:957:15)
    at Function.Module._load (internal/modules/cjs/loader.js:840:27)
    at Module.require (internal/modules/cjs/loader.js:1019:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object. (/home/frappe/frappe-bench/apps/frappe/node_modules/snyk/node_modules/@snyk/dep-graph/src/core/create-from-json.ts:3:1)
    at Module._compile (internal/modules/cjs/loader.js:1133:30)
    at Object.Module._extensions…js (internal/modules/cjs/loader.js:1153:10)
    at Module.load (internal/modules/cjs/loader.js:977:32)
    at Function.Module._load (internal/modules/cjs/loader.js:877:14)
    at Module.require (internal/modules/cjs/loader.js:1019:19)
    error Command failed with exit code 1.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
    error Command failed with exit code 1.
    info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Tried: npm install graphlib ?

Tried but no luck

Try: bench update --requirements and bench restart

umm… I seem to be getting this error only when running bench update --requirements… and rerunning did not solve my problem…

here is what solved my issue:
I deleted all the node_modules directories using find -type d -name node_modules -prune -exec rm -rf {} \;

and then reran bench update --requirements / bench setup requirements.

This was required too.

This happened to me on develop branch only

Didn’t understand… Can you explain?

nom install graphlib
bench setup requirements

Both were required to be run

1 Like