Home > Net >  ENOENT: no such file or directory, open './config/secrets.json'
ENOENT: no such file or directory, open './config/secrets.json'

Time:12-28

I am working on a git clone with a co-worker and I am fairly new to coding, so pardon my novice. I opened a git clone and when I try to run npm run serve, I get a no such file or directory open.

I have tried deleting the package-lock.json as well as the node-modules, then restarting with npm install and then npm cache clean,then npm install -g npm,then npm install,Finally ng serve --o

as well as various other methods including renaming the file, but I do not understand where I have gone wrong. Here is some code. Thank you for your time

[0] node:internal/fs/utils:344
[0]     throw err;
[0]     ^
[0]
[0] Error: ENOENT: no such file or directory, open './config/secrets.json'
[0]     at Object.openSync (node:fs:585:3)
[0]     at Object.readFileSync (node:fs:453:35)
[0]     at Object.<anonymous> (C:\Users\jlemke\JL Code\service-field-report\app.js:10:29)
[0]     at Module._compile (node:internal/modules/cjs/loader:1101:14)
[0]     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
[0]     at Module.load (node:internal/modules/cjs/loader:981:32)
[0]     at Function.Module._load (node:internal/modules/cjs/loader:822:12)
[0]     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
[0]     at node:internal/main/run_main_module:17:47 {
[0]   errno: -4058,
[0]   syscall: 'open',
[0]   code: 'ENOENT',
[0]   path: './config/secrets.json'
[0] }

CodePudding user response:

This is a common model for working with version control, where secret information like passwords etc is kept and distributed separately.

Most likely if you look in .gitignore you will see config/secrets.json listed as not to be included in the project.

You might be able to work round this by creating an empty config/secrets.json file - but more likely you will need to get this file (or the contents) direct from your co-worker.

  • Related