Nx Upgrade from v11 to v12.10.1 is giving "Module not found" error during migration - nrwl-nx

I am currently on Nx version 11 using Angular 11 in my project. I am trying to upgrade Nx to v12.10.1. I believe it is the last update of Nx to use Angular 12 in my project. So far, here is what I did.
Update Node to v18.3.0
Update NPM to v8.11.0
Run command npx nx migrate 12.10.1
Fetching meta data about packages.
It may take a few minutes.
Fetching #nrwl/workspace#12.10.1
Fetching #nrwl/cypress#12.10.1
Fetching #nrwl/angular#12.10.1
Fetching #nrwl/jest#12.10.1
Fetching #nrwl/linter#12.10.1
Fetching #ngrx/effects#12.4.0
Fetching #ngrx/store#12.4.0
Fetching #ngrx/store-devtools#12.4.0
Fetching #angular/material#12.2.13
Fetching #angular/core#12.2.16
Fetching #angular/cdk#12.2.13
Fetching #angular/cli#12.2.17
Fetching #ngrx/router-store#12.4.0
Fetching #angular/cli#~12.2.0
No errors. Hence, continue.
rm -rf node_modules/ package-lock.json To do it fresh installation.
fresh npm install
Run command npx nx migrate --run-migrations
Got an error as code: MODULE_NOT_FOUND. "Cannot find module #nrwl/tao/src/utils/app-root". screenshot attached.
Any ideas on how to fix this?

Related

Is there any other way That I can run my application

Hi I'm trying to run an application in vs code, when I hit on tns run I get this error "The current application is not compatible with NativeScript CLI 8.2.3.
Run 'ns migrate' to migrate your project to the latest NativeScript version.
Alternatively you may try running it with '--force' to skip this check.".
When I try to run ns migrate I also get this error "Error: spawn git ENOENT
at onErrorNT (node:internal/child_process:478:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21)".
Note: I did installed NativeScript 8.2.3.
Please help.

sequelize keeps showing same message again and again with no errors

Sequelize keeps showing "Loaded configuration file "config\config.json".
Using environment "development"." after every command.
Edit: solved by updating all dependencies to the latest version
npm i sequelize#latest pg#latest pg-hstore#latest
Solved by updating dependencies
npm i sequelize#latest pg#latest pg-hstore#latest

Magento 2.3.5 fresh installtion using composer results in error

I am trying to install Magento 2.3.5 using composer.
muk#muk:/var/www/html$ composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.3.5 magento23
Creating a "magento/project-community-edition" project at "./magento23"
Installing magento/project-community-edition (2.3.5-p1)
- Installing magento/project-community-edition (2.3.5-p1): Loading from cache
Created project in /var/www/html/magento23
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 463 installs, 0 updates, 0 removals
- Installing magento/magento-composer-installer (0.1.13): Loading from cache
- Installing laminas/laminas-dependency-plugin (1.0.3): Loading from cache
Plugin installation failed (include(/var/www/html/magento23/vendor/laminas/laminas-dependency-plugin/src/DependencyRewriterPlugin.php): failed to open stream: No such file or directory), rolling back
- Removing laminas/laminas-dependency-plugin (1.0.3)
[ErrorException]
include(/var/www/html/magento23/vendor/laminas/laminas-dependency-plugin/src/DependencyRewriterPlugin.php): failed to open stream: No such file or directory
create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--repository REPOSITORY] [--repository-url REPOSITORY-URL] [--add-repository] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [--no-secure-http] [--keep-vcs] [--remove-vcs] [--no-install] [--ignore-platform-reqs] [--] [<package>] [<directory>] [<version>]
I am getting following error.
Plugin installation failed (include(/var/www/html/magento23/vendor/laminas/laminas-dependency-plugin/src/DependencyRewriterPlugin.php): failed to open stream: No such file or directory), rolling back
- Removing laminas/laminas-dependency-plugin (1.0.3)
My Composer version
muk#muk:/var/www/html$ composer --version
Composer version 1.10.5 2020-04-10 11:44:22
I am using VirtualBox with Shared folder.
How can I fix it?
Note: To fix it I stopped using shared folder. Now I keep the entire code in the VM and do not use shared folder. For file synching I am using mutagen.
if anyone runs into this issue, it looks to be a problem with virtualBox and shared folders. when unzipping files, they are not immediately available in the environment.
the solution is by rkamp and is also available here:
https://stackoverflow.com/a/66413857/1470145
in short, one needs to override unzip to add a brief delay after unzipping.
I thought I had the same issue, but turned out it was something else.
The upgrade went OK for me, for a sandbox/clean 2.3.4 install, and a client project running 2.3.4.
A few things:
This could possibly be an issue with your cache, try to clear your composer laminas cache (~/.composer/cache/files/laminas usually)
Although it would complain about that, you've possibly got unmet platform requirements (php version, etc.)
Try clearing your entire composer cache (~/.composer)
Double-check the repository URL (should it be 2.3.5 or 2.3.5-p1?)
Hope that helps

spawn EACCES error when serving ionic app

I am using Ionic CLI version 4.2.1 and Ionic Framework version 3.9.2. When I try and use ionic server in my app I get this error:
Error: spawn EACCES
at _errnoException (util.js:992:11)
at ChildProcess.spawn (internal/child_process.js:323:11)
at Object.exports.spawn (child_process.js:502:9)
at spawn
(/usr/local/lib/node_modules/ionic/node_modules/cross-
spawn/index.js:17:18)
at spawn
(/usr/local/lib/node_modules/ionic/node_modules/#ionic/cli-
framework/utils/shell.js:131:12)
at ShellCommand.spawn
(/usr/local/lib/node_modules/ionic/node_modules/#ionic/cli-
framework/utils/shell.js:120:16)
at Shell.
(/usr/local/lib/node_modules/ionic/lib/shell.js:161:27)
at Generator.next ()
at fulfilled
(/usr/local/lib/node_modules/ionic/node_modules/tslib/tslib.js:104:62)
at
I got the codebase from another person using the same versions as me, but I have not been able to run it once on my machine.
This is either a permission issue or a a node_modules issue. It's because you transfered the full project folder from another computer.
To resolve the issue, run :
npm rebuild
To clear npm cache and rebuild your modules
And :
chmod 755 -R /yourpath/to/node_modules
The error may be caused by an installation of a module which was made insudo mode

cordova add plugin - unable to access

I am trying to add a plugin to Cordova via
cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git
git itself seems to run fine. Running the following works:
git clone "https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git" "D:\Temp\plugman-tmp1390234462383"
This is what is used in plugins.js line 43 (var cmd = util.format(...)).
The error I receive using the cordova plugin add ... is:
Calling plugman.fetch on plugin "https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git"
Fetching plugin from "https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git"...
Fetching plugin via git-clone command: git clone "https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git" "D:\Temp\plugman-tmp1390235833828"
C:\Users\myUser\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:126
throw e;
^
Error: Fetching plugin failed: Error: Command failed: Cloning into 'D:\Temp\plugman-tmp1390234462383'...
fatal: unable to access 'https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git/': Failed connect to git-wip-us.apache.org:443; No error
at C:\Users\myUser\AppData\Roaming\npm\node_modules\cordova\src\plugin.js:90:41
at _rejected (C:\Users\myUser\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:808:24)
at C:\Users\myUser\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:834:30
at Promise.when (C:\Users\myUser\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:1079:31)
at Promise.promise.promiseDispatch (C:\Users\myUser\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:752:41)
at C:\Users\myUser\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:574:44
at flush (C:\Users\myUser\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:108:17)
at process._tickCallback (node.js:415:13)
Any idea?
Some more information:
I am going through a proxy, but I set this for git and for npm. I installed Cordova via "npm install cordova" and the project via "cordova create TestApp", I added platforms via "cordova platform add android" and I can run the app on the emulator.
I even tried "phonegap local plugin add https..." with the same result.
All that is missing for me is to add plugins.
Sometimes a Cordova update will cause problems with npm and will corrupt the "cordova cache" that NPM uses to quickly download different Cordova versions. I know there were problems with the server pushing the latest Cordova plugins to NPM, so maybe this is why you're having trouble.
I'd suggest deleting /AppData/Roaming/npm/node_modules/cordova direct in its entirety, than installing a fresh new copy with npm install -g cordova. This shouldn't remove any of your Cordova projects, it will just download a fresh set of the tools. When you run cordova commands, it might take longer the first time since the tools will have to go to the git repo's and fetch the content fresh.
Tried clearing the cordova cache by deleting the folder as suggested by #mbillau but that didn't help. I search for the plugin where I was getting the error and tried installing through command line but got the same error message. Finally the solution that worked for me:
open important files in your IDE
open Cordova plugins
replace all "https://git-wip-us.apache.org/repos/asf/" with "https://git.apache.org/"
and it worked perfectly.
Replace "git-wip-us.apache.org/repos/asf7" with "github.com/apache/"
Like #Max said.
Checking the apache site (either https://git-wip-us.apache.org/repos/asf/, https://gitbox.org/repos/asf/, or https://git.apache.org/) I only see commit logs instead of the sources.
The sources can be found on GitHub. This worked for me:
cordova plugin add https://github.com/apache/cordova-plugin-device.git