Error when trying to run project https://github.com.mcas.ms/floriankammermann/landscapeapp locally on my windows machine.
I am attempting to run the project from this repo:
https://github.com.mcas.ms/floriankammermann/landscapeapp
I cloned the project and installed the dependencies and now trying to run the project using ‘yarn run open:src’ I am getting the following error:
yarn dev
$ yarn yaml2json && yarn prepare-landscape && NODE_OPTIONS='--inspect' next dev
$ babel-node tools/generateJson.js
processed C:/Users/Adia-May/Git_repos/landscapes/cdf-landscape
$ babel-node tools/prepareLandscape.js
node:internal/fs/utils:347
throw err;
^
Error: ENOENT: no such file or directory, lstat 'public'
at Object.lstatSync (node:fs:1574:3)
at __node_internal_ (node:internal/fs/utils:803:8)
at rmdirSync (node:fs:1215:15)
at Object.<anonymous> (C:UsersAdia-MayGit_reposlandscapeslandscapeapptools/prepareLandscape.js:13:10)
at Module._compile (node:internal/modules/cjs/loader:1226:14)
at Module._compile (C:UsersAdia-MayGit_reposlandscapeslandscapeappnode_modulespirateslibindex.js:136:24)
at Module._extensions..js (node:internal/modules/cjs/loader:1280:10)
at Object.newLoader [as .js] (C:UsersAdia-MayGit_reposlandscapeslandscapeappnode_modulespirateslibindex.js:141:7)
at Module.load (node:internal/modules/cjs/loader:1089:32)
at Function.Module._load (node:internal/modules/cjs/loader:930:12) {
errno: -4058,
syscall: 'lstat',
code: 'ENOENT',
path: 'public'
}
Node.js v18.14.0
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/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
‘public’ doesnt seem to be a file in the project
Here is the scripts from the package.json file:
"scripts": {
"autocrop-images": "babel-node tools/autocropImages",
"dev": "yarn yaml2json && yarn prepare-landscape && NODE_OPTIONS='--inspect' next dev",
"open:src": "yarn dev",
"open:dist": "yarn stop-old-ci && babel-node tools/distServer.js",
"get-iframe-resizer-path": "node -e "console.info(require.resolve('iframe-resizer/js/iframeResizer.min.js'))" ",
"landscapes": "babel-node tools/landscapes.js",
"lint": "esw webpack.config.* src tools --color",
"lint:watch": "yarn lint -- --watch",
"update-github-colors": "curl https://raw.githubusercontent.com/Diastro/github-colors/master/github-colors.json > tools/githubColors.json",
"migrate": "babel-node tools/migrate",
"fetch": "babel-node tools/validateLandscape && yarn migrate && babel-node tools/checkWrongCharactersInFilenames && babel-node tools/addExternalInfo.js && yarn yaml2json",
"fetchAll": "LEVEL=complete yarn fetch",
"update": "(rm /tmp/landscape.json || true) && babel-node tools/validateLandscape && yarn migrate && yarn remove-quotes && LEVEL=medium babel-node tools/addExternalInfo.js && yarn prune && yarn check-links && yarn yaml2json && babel-node tools/calculateNumberOfTweets && babel-node tools/updateTimestamps",
"yaml2json": "babel-node tools/generateJson.js",
"remove-quotes": "babel-node tools/removeQuotes",
"prune": "babel-node tools/pruneExtraEntries",
"check-links": "babel-node tools/checkLinks",
"remove-dist": "rimraf "$PROJECT_PATH"/dist",
"precommit": "yarn fetch",
"host-images": "babel-node tools/hostImages.js && yarn fetch",
"start-ci": "yarn exec bash -c "(yarn run babel-node tools/distServer.js &) && sleep 10"",
"stop-old-ci": "yarn run babel-node tools/stopOldDistServer.js",
"stop-ci": "yarn exec bash -c "kill -9 `cat /tmp/ci.pid` >/dev/null 2>/dev/null && rm /tmp/ci.pid "",
"integration-test": "jest ${JEST_OPTIONS:-} --reporters=./tools/jestReporter.js --reporters=jest-standard-reporter",
"check-landscape": "babel-node tools/checkLandscape",
"render-landscape": "babel-node tools/renderLandscape",
"funding": "babel-node tools/fundingForMasterBranch",
"copy-dist": "cp -r _headers out && ([ -z "${PROJECT_NAME:-}" ] || mkdir "$PROJECT_PATH"/dist ) && cp -r out/ "$PROJECT_PATH"/dist/${PROJECT_NAME:-}",
"prepare-landscape": "babel-node tools/prepareLandscape.js",
"setup-robots": "babel-node tools/sitemap && babel-node tools/addRobots",
"quick-build": "yarn build-next && yarn setup-robots && yarn copy-dist ",
"build": "((yarn fetch && yarn prepare-landscape && yarn build-next && yarn setup-robots && yarn remove-dist && yarn copy-dist && yarn stop-old-ci && yarn start-ci && babel-node tools/parallelWithRetry integration-test check-landscape render-landscape funding) || (yarn stop-old-ci && false)) && babel-node tools/parallelWithRetry integration-test && yarn stop-ci",
"build-custom": "yarn fetch && yarn prepare-landscape && yarn build-next && yarn setup-robots && yarn remove-dist && yarn copy-dist",
"build-next": "next build && next export",
"show-report": "open dist/report.html",
"analyze-bundle": "babel-node ./tools/analyzeBundle.js",
"latest": "yarn",
"reset-tweet-count": "babel-node tools/resetTweetCount.js",
"prepublish": "cp yarn.lock _yarn.lock",
"postpublish": "rm _yarn.lock || true"
}
What does this mean? I am a complete novice in react and yarn and have been trying to fix the error for a week or so. Is it a runtime error or a problem with my installation? I can upload any files needed
Thanks!
2
Answers
I found out my issue, I had dependency issues after calling
yarn
to download dependencies.Sounds like you may need to run
yarn build
. What is creating thepublic
folder? Do a search forpublic
in your entire code-base.