Closed itayod closed 3 years ago
nx seems to start generating without finding the correct path,the real path should be in HIDDEN_PATH/diandiantu
instead of HIDDEN_PATH/diandiantu/apps/ddt/src/app
➜ ng g c --verbose
ENOENT: no such file or directory, open 'HIDDEN_PATH/diandiantu/apps/ddt/src/app/workspace.json'
Error: ENOENT: no such file or directory, open 'HIDDEN_PATH/diandiantu/apps/ddt/src/app/workspace.json'
at Object.openSync (fs.js:476:3)
at Object.readFileSync (fs.js:377:35)
at Workspaces.readWorkspaceConfiguration (HIDDEN_PATH/diandiantu/node_modules/@nrwl/tao/src/shared/workspace.js:19:33)
at Object.<anonymous> (HIDDEN_PATH/diandiantu/node_modules/@nrwl/tao/src/commands/generate.js:142:44)
at Generator.next (<anonymous>)
at HIDDEN_PATH/diandiantu/node_modules/tslib/tslib.js:114:75
at new Promise (<anonymous>)
at Object.__awaiter (HIDDEN_PATH/diandiantu/node_modules/tslib/tslib.js:110:16)
at HIDDEN_PATH/diandiantu/node_modules/@nrwl/tao/src/commands/generate.js:141:63
at Object.<anonymous> (HIDDEN_PATH/diandiantu/node_modules/@nrwl/tao/src/shared/params.js:10:26)
find the problem, there is no recursion upwards to find the correct directory here. https://github.com/nrwl/nx/blob/075fe9446b16e4e5c8bba78e4cb85888e5e50fe9/packages/tao/index.ts#L76 https://github.com/nrwl/nx/blob/0875d19ad3336ee95042517accc2966c50ae97e4/packages/cli/lib/init-local.ts#L66
Have the same issue
@vsavkin thanks for the quick fix though I am not sure if that's related, but it seems like every command is now generated under the application root path, e.g. apps/my-app/src/app
.
So for example, if I am trying to create a new component under apps/my-app/src/app/some/nested/folder
it will be generated in apps/my-app/src/app
.
Please let me know if you would like me to create a new issue with further explanation for this one.
Thanks.
@vsavkin ping
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
After upgraded my workspace to NX 11 it seems that every schematics command is broken given the following error:
ENOENT: no such file or directory, open 'apps\app\src\app\workspace.json'
.I also tried it on a new workspace environment but got the same results.
Expected Behavior
Angular schematics commands to work.
Steps to Reproduce
ng g component hello
).Failure Logs
Environment