Closed batbrain9392 closed 3 years ago
I have the same issue just now!
On my side, I'm still using angular.json (or workspace.json with version=1). So I think we should upgrade workspace.json to version 2. But if yes, the question is how to do this ?
Anybody has some tips to do that smoothly ? (need to rename architects to generators....) Thanks!
oh...
I renamed angular.json
to workspace.json
, as described in docs
Then changed version:1
to version:2
Then nx g @nrwl/workspace:convert-to-nx-project --all
was working, and converted all projects.
(press Enter without any name of project)
Each project configuration was moved to project.json
with also new syntax (executors, generators...)
Tacking on here (let me know if it should be it's own issue) when using Angular.json and migrating apps to the new project.json
format (after changing version in angular.json
to 2) I get Unable to read workspace file 'angular.json': Invalid format version detected - Expected:[ 1 ] Found: [ 2 ]
Tacking on here (let me know if it should be it's own issue) when using Angular.json and migrating apps to the new
project.json
format (after changing version inangular.json
to 2) I getUnable to read workspace file 'angular.json': Invalid format version detected - Expected:[ 1 ] Found: [ 2 ]
Was having the same issue. Renaming angular.json to workspace.json got this working for me
That worked for me too.
However, once I add a new project with the @nrwl/angular:library
schematic it basically undoes all the changes, even if I specify the standaloneConfig
flag. Does anyone else have the same problem?
In the new version 12.5.1
, The error messages were improved -
NX Only workspaces with version 2+ support project.json files.
To upgrade change the version number at the top of angular.json and run 'nx format'.
v2+ Required
Now, simply changing version 1
to 2
in angular.json
and then running npx nx g @nrwl/workspace:convert-to-nx-project --all
works.
Q: Which also begs the question, what's the benefit of renaming angular.json
to workspace.json
?
A: Otherwise, the project straight out won't run. Also, Nx Console won't recognise the projects.
That worked for me too.
However, once I add a new project with the
@nrwl/angular:library
schematic it basically undoes all the changes, even if I specify thestandaloneConfig
flag. Does anyone else have the same problem?
yep, the standaloneConfig flag has no affect for me either
Ok for me, by following @batbrain9392 instructions. Angular.json => Workspace.json v2 All project.json created.
After 12.5.1 fix, it works smoothly ! Great. Thanks!
You still have to rename your angular.json into workspace.json even in 12.5.1 and even after doing a nx format
.
Otherwise everything is working fine into VSCode.
But using bitbucket pipeline, I've got this error when doing npx nx run-many --all --target=test --parallel
Error: ENOENT: no such file or directory, open '/opt/atlassian/pipelines/agent/build/apps\xxx/project.json'
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
On running
npx nx g @nrwl/workspace:convert-to-nx-project
, I get this error - Only workspace's with version 2+ support project.json filesExpected Behavior
It should create the per-project config. Is this a regression? - No
Steps to Reproduce
npx create-nx-workspace --preset=angular
(uses npm, not yarn)npx nx g @nrwl/workspace:convert-to-nx-project --project shell
You could try it on this example repo.
Failure Logs
ERROR Only workspace's with version 2+ support project.json files.
Environment
Node : 14.17.1 OS : linux x64 npm : 6.14.13
nx : Not Found @nrwl/angular : 12.5.0 @nrwl/cli : 12.5.0 @nrwl/cypress : 12.5.0 @nrwl/devkit : 12.5.0 @nrwl/eslint-plugin-nx : 12.5.0 @nrwl/express : Not Found @nrwl/jest : 12.5.0 @nrwl/linter : 12.5.0 @nrwl/nest : Not Found @nrwl/next : Not Found @nrwl/node : Not Found @nrwl/react : Not Found @nrwl/schematics : Not Found @nrwl/tao : 12.5.0 @nrwl/web : Not Found @nrwl/workspace : 12.5.0 @nrwl/storybook : 12.5.0 @nrwl/gatsby : Not Found typescript : 4.2.4