Closed DmitryEfimenko closed 1 year ago
@DmitryEfimenko I couldn't reproduce the issue. I wonder if it's OS-specific. Are you running on Windows? The nx report
is cut at the top and I only see the package manager, not the OS.
I am indeed on Windows 11
Cool, I think I know what's going on. I'll reproduce it on a VM just to be sure and push a fix. Thanks for the info!
I could not reproduce the issue on a Windows VM either 🤔
I cloned the repo, migrated it to next
and ran the same command pasted in the reproduction steps. Are you having the issue in a different branch? Or do you have any changes that are not pushed?
I do have changes that are not pushed. I didn't think they would affect anything. Let me try and create a clean repro - perhaps on a different branch. Thanks for looking into it and I'm sorry for bad repro. I'll update here with clean repro shortly
No worries! It's currently late for me, so if you leave updated details, I'll have a look tomorrow.
Could you please see if you can reproduce on branch feat/super?
git checkout feat/super
npm install --force
npm run nx -- g @nrwl/angular:move --project ng-superclass --destination ./ng-superclass/package --dry-run
I've run these steps on a different computer (also Windows, but version 10) that didn't have this repository. Interestingly, I got a different error:
> NX Cannot find packages\ng-superclass\project.json
Error: Cannot find packages\ng-superclass\project.json
at readJson (C:\source\ngspot\node_modules\@nrwl\angular\node_modules\nx\src\generators\utils\json.js:14:15)
at C:\source\ngspot\node_modules\@nrwl\angular\node_modules\nx\src\generators\utils\project-configuration.js:120:119
at buildProjectsConfigurationsFromGlobs (C:\source\ngspot\node_modules\@nrwl\angular\node_modules\nx\src\config\workspaces.js:479:35)
at readAndCombineAllProjectConfigurations (C:\source\ngspot\node_modules\@nrwl\angular\node_modules\nx\src\generators\utils\project-configuration.js:120:66)
at readProjectConfiguration (C:\source\ngspot\node_modules\@nrwl\angular\node_modules\nx\src\generators\utils\project-configuration.js:80:25)
at updateModuleName (C:\source\ngspot\node_modules\@nrwl\angular\src\generators\move\lib\update-module-name.js:17:59)
at C:\source\ngspot\node_modules\@nrwl\angular\src\generators\move\move.js:19:51
at Generator.next (<anonymous>)
at fulfilled (C:\source\ngspot\node_modules\tslib\tslib.js:164:62)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
@DmitryEfimenko it looks like a hoisting issue with npm and those beta versions. Using --legacy-peer-deps
instead of force
works (having deleted node_modules
first) and also using another package manager like Yarn.
That said, the stable release 15.8.0 is now out. Migrating the workspace to latest make the error go away.
I'm going to close the issue since it's resolved in latest. Please make sure to migrate to latest.
I updated nx deps to the latest (15.8.1) and it worked... somewhat.
I created a new issue to describe the bugs I observed: https://github.com/nrwl/nx/issues/15354
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
Attempting to move an Angular project results in an error:
Cannot read properties of null (reading 'replace')
Expected Behavior
The command should succeed.
GitHub Repo
https://github.com/DmitryEfimenko/ngspot
Steps to Reproduce
npm run nx -- migrate next
(and follow normal migration steps)npm run nx -- g @nrwl/angular:move --project ng-superclass --destination ./ng-superclass/package --dry-run
When the same command is run with
--verbose
option, the following error is shown:Nx Report
Failure Logs
No response
Additional Information
Moving a non-angular project into a subfolder works as expected.