I am trying to build datahub locally but I keep ru...
# troubleshoot
g
I am trying to build datahub locally but I keep running into an issue. I hoping someone might be able to offer some suggestions. I am building on a Mac with an x86 chip using node 16.15.0, npm 8.5.5, yarn 1.22.15
Copy code
> Task :datahub-web-react:yarnGenerate FAILED
yarn run v1.22.0
$ graphql-codegen --config codegen.yml
node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module './_baseClone'
Require stack:
- /Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/lodash/clone.js
- /Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/@graphql-tools/graphql-tag-pluck/node_modules/@babel/types/lib/builders/builder.js
- /Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/@graphql-tools/graphql-tag-pluck/node_modules/@babel/types/lib/builders/generated/index.js
- /Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/@graphql-tools/graphql-tag-pluck/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js
- /Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/@graphql-tools/graphql-tag-pluck/node_modules/@babel/types/lib/builders/react/buildChildren.js
- /Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/@graphql-tools/graphql-tag-pluck/node_modules/@babel/types/lib/index.js
- /Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/@graphql-tools/graphql-tag-pluck/index.cjs.js
- /Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/@graphql-tools/code-file-loader/index.cjs.js
- /Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/@graphql-codegen/cli/bin.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:94:18)
    at Object.<anonymous> (/Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/lodash/clone.js:1:17)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/lodash/clone.js',
    '/Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/@graphql-tools/graphql-tag-pluck/node_modules/@babel/types/lib/builders/builder.js',
    '/Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/@graphql-tools/graphql-tag-pluck/node_modules/@babel/types/lib/builders/generated/index.js',
    '/Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/@graphql-tools/graphql-tag-pluck/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js',
    '/Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/@graphql-tools/graphql-tag-pluck/node_modules/@babel/types/lib/builders/react/buildChildren.js',
    '/Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/@graphql-tools/graphql-tag-pluck/node_modules/@babel/types/lib/index.js',
    '/Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/@graphql-tools/graphql-tag-pluck/index.cjs.js',
    '/Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/@graphql-tools/code-file-loader/index.cjs.js',
    '/Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/@graphql-codegen/cli/bin.js'
  ]
}
error Command failed with exit code 1.
info Visit <https://yarnpkg.com/en/docs/cli/run> for documentation about this command.
o
It seems like maybe your node_modules are having a caching problem. Can you try cleaning your node cache and yarn cache then rebuilding?
g
I ran:
Copy code
% npm cache clean -force
npm WARN using --force Recommended protections disabled.
% yarn cache clean
yarn cache v1.22.15
success Cleared cache.
✨  Done in 0.02s.
However I get the same error message as above.
o
Hmm, how did you install yarn & npm? Any ideas here @green-football-43791?
g
whats the output of
yarn install
?
from
datahub-web-react
? does that complete successfully?
and what about
yarn generate
from
datahub-web-react
?
g
Here are the output of both commands:
Copy code
% yarn install
yarn install v1.22.15
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] 🔍  Resolving packages...
success Already up-to-date.
✨  Done in 0.71s.
and
Copy code
% yarn generate
yarn run v1.22.15
$ graphql-codegen --config codegen.yml
node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module './_baseClone'
Require stack:
- /Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/lodash/clone.js
- /Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/@graphql-tools/graphql-tag-pluck/node_modules/@babel/types/lib/builders/builder.js
- /Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/@graphql-tools/graphql-tag-pluck/node_modules/@babel/types/lib/builders/generated/index.js
- /Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/@graphql-tools/graphql-tag-pluck/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js
- /Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/@graphql-tools/graphql-tag-pluck/node_modules/@babel/types/lib/builders/react/buildChildren.js
- /Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/@graphql-tools/graphql-tag-pluck/node_modules/@babel/types/lib/index.js
- /Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/@graphql-tools/graphql-tag-pluck/index.cjs.js
- /Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/@graphql-tools/code-file-loader/index.cjs.js
- /Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/@graphql-codegen/cli/bin.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/lodash/clone.js:1:17)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/lodash/clone.js',
    '/Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/@graphql-tools/graphql-tag-pluck/node_modules/@babel/types/lib/builders/builder.js',
    '/Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/@graphql-tools/graphql-tag-pluck/node_modules/@babel/types/lib/builders/generated/index.js',
    '/Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/@graphql-tools/graphql-tag-pluck/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js',
    '/Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/@graphql-tools/graphql-tag-pluck/node_modules/@babel/types/lib/builders/react/buildChildren.js',
    '/Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/@graphql-tools/graphql-tag-pluck/node_modules/@babel/types/lib/index.js',
    '/Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/@graphql-tools/graphql-tag-pluck/index.cjs.js',
    '/Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/@graphql-tools/code-file-loader/index.cjs.js',
    '/Users/dcurran/Documents/git_projects/df-datahub/datahub-web-react/node_modules/@graphql-codegen/cli/bin.js'
  ]
}
error Command failed with exit code 1.
info Visit <https://yarnpkg.com/en/docs/cli/run> for documentation about this command.
o
Can you run a
git status
to see if there is a lock file that has been generated that is not the one saved with the repo?
v
Hey, I’m having a similar issue, described here https://datahubspace.slack.com/archives/C029A3M079U/p1652986088021729 Have you found the solution for your issue?
hey, I think I found a solution for my issue: 1. Delete
node_modules
in
datahub-web-react/
and
docs-website
2. Run
yarn install
manually in
datahub-web-react/
and
docs-website
I don’t know much about Gradle, but it seems that the node modules installed with Gradle weren’t working.