Closed GaryB432 closed 1 year ago
Can you run nx graph
and send a picture of the graph?
nx graph
NX ENOENT: no such file or directory, open \D:\ws\apps\my-app\project.json'
Because of the error the Nx daemon process has exited. The next Nx command is going to restart the daemon process. If the error persists, please run "nx reset".
and an `cmd` window left open with `[process exited with code 1 (0x00000001)]`
These results repeat if I run `nx reset`
That leading path separator looks suspicious.
Was that ☝🏻all you needed? Is this still blocked?
Hey, sorry, haven't gotten back to this just yet. Looking at it now, can you try running again with the following two environment variables set?
NX_DAEMON=false
NX_VERBOSE_LOGGING=true
Thanks for looking (I see btw that you are a fellow midwesterner!)
Got a good stack trace from nx graph
Error: ENOENT: no such file or directory, open 'D:\ws\apps\my-app\project.json'
at Object.openSync (node:fs:599:3)
at readFileSync (node:fs:467:35)
at readJsonFile (D:\ws\node_modules\nx\src\utils\fileutils.js:18:43)
at D:\ws\node_modules\nx\src\config\workspaces.js:386:61
at Array.forEach (<anonymous>)
at inlineProjectConfigurations (D:\ws\node_modules\nx\src\config\workspaces.js:383:38)
at resolveNewFormatWithInlineProjects (D:\ws\node_modules\nx\src\config\workspaces.js:379:24)
at Workspaces.readFromWorkspaceJson (D:\ws\node_modules\nx\src\config\workspaces.js:270:16)
at Workspaces.readWorkspaceConfiguration (D:ws\node_modules\nx\src\config\workspaces.js:59:78)
at readAllWorkspaceConfiguration (D:\ws\node_modules\nx\src\config\configuration.js:15:72)
Yeah.. that project.json file def does not exist :)
It sounds like that file definitely should exist. If you look in workspace/angular.json is there a project definition that points to apps/my-app?
ahhh sure enough. Hmm such a flurry I don't know how that got there. I only executed the couple lines I put in the repro-steps above.
Latest findings...
Environment variables set as above
Same repro steps as above, i.e., create-nx-workspace* and create package.json
Run nx echo my-app
gives 'Cannot find project my-app
but with no verbose logging
No workspace json
created.
nx graph
shows no errors and a graph with no projects which seems consistent with my situation
* however this did give Cannot read properties of undefined (reading 'create')
but seemed to create my workspace. I guess that's another issue.
Yeah, in 15 you'd need to setup yarn / npm / pnpm workspaces to enable the project inference. We look at those patterns.
This seems to work in earlier 15 like 15.0.3 but that did it. Just checking my understanding....
Nx finds
project.json
s by scanning but aworskspaces
key is needed in rootpackage.json
for it to find mypackage.json
s.
Maybe just a docs
label on this then. Thanks for the help!
https://github.com/nrwl/nx/pull/13203 this should contain that info.
I'm going to close this out since we diagnosed the issue successfully.
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.
Current Behavior
Nx "Cannot find" my project
Expected Behavior
I expect Nx to run my target in
apps/my-app/package.json
Steps to Reproduce
add
apps/my-app/package.json
continue
Failure Logs
As mentioned above
Environment