CircleCI Build Failing, Module not found, even with NODE_PATH

Hello, awesome people from the CircleCI community. I’m fairly new at CircleCI build config and things like that and is stuck with my build failing with Module not found, for days now.

I did some research, and added NODE_PATH=./src in package.json build scripts, even tried creating .env file with NODE_PATH=src, both method works locally, but the committed repository on CircleCI is always failing. I even tried changing the code imports from absolute path to relative path, still no luck. Tried all variations of NODE_PATH=./src everything works locally, but not on CircleCI. Even tried setting environment on config.yml. Any ideas? I’m at my wit’s end.

config.yml
- run:
name: (Production) Build
command: npm run build
environment:
NODE_PATH: src/

Please check [https://github.com/creativetimofficial/material-kit-react/issues/41(https://github.com/creativetimofficial/material-kit-react/issues/41) for more information. Thank you very much.

1 Like

I wonder if it would help if NODE_PATH was absolute and not relative?

(Your link is broken, by the way - would you repair?)

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.