how to implement redux in angular9? - angularjs

I am trying to use redux in my application but I am getting error as:
The target entry-point "#angular-redux/store" has missing dependencies:
- redux
- redux-devtools-extension
Any suggestions.

You can install implement redux in angular by three dependencies.
npm install redux --save
npm install #angular/core --save
npm install redux-devtools --save

As it said,
please install it.
npm install redux-devtools-extension .
Eventhough its a dev dependency, this we've to install manually

Though they should have come in as dependencies with the initial package install, try manually installing redux and redux-devtools:
npm install redux
npm install redux-devtools

Related

How to downgrade React version 17 to 16?

How can I downgrade my React version from 17 to 16 as many of the React packages are not supported by React 17?
Assuming you're using npm/yarn or another node package manager, dependency versions are listed in package.json.
Search for the react and react-dom packages under dependencies (or devDependencies) and replace their versions with 16.13.0. Then run npm install or yarn or whatever package manager you're using. This should be enough to downgrade to React 16.
If you have packages not compatible with React 16, you might have to downgrade them, too.
After updating dependencies inside package.json you need to run npm install for the changes to take place.
Or if you want to do it all inside of command line you can do it like this:
npm install --save react#16.13.0 react-dom#16.13.0
Source: linasmnew's answer to reactjs - Going back from React 16 to 15 - Stack Overflow
Because I needed redux-devtools as a package on an old project, I had to downgrade from React v17 to React v16. That's what i have done:
npm uninstall react-redux npm uninstall redux
npm install --save react#16.14.0 react-dom#16.14.0
npm install redux npm install react-redux
npm install --save-dev redux-devtools

Module not found: Can't resolve '#aws-amplify/core'

Trying to create a React App using amplify authentication, stuck with this error
Module not found: Can't resolve '#aws-amplify/core' in '..\node_modules#aws-amplify\api\lib-esm'
I have been referring to these two links:
https://dev.to/dabit3/the-complete-guide-to-user-authentication-with-the-amplify-framework-2inh
https://docs.amplify.aws/lib/auth/getting-started/q/platform/js
What have I already tried:
deleting node_modules and reinstalling the project
trying to explicitly install #aws-amplify/core using npm (This throws a separate error)
Any help is appreciated :)
I ran into this issue working with AWS Datastore which also depends on #amplify/core. Here's how I resolved it:
npm i #aws-amplify/core --save --legacy-peer-deps
React component:
import Amplify from "#aws-amplify/core
The legacy peer deps flag was required in my case as the install React version was greater than the version required for amplify/core. You may also need to amplify init or amplify pull first if you've not already done so.
The perfect solution is as mentioned above. I found this after a lot of research. Need to install #aws-amplify/core. But along with that in my react app, I have to install some more packages for cognito to work properly.
npm i #aws-amplify/core --save --legacy-peer-deps
npm i #aws-amplify/storage --save --legacy-peer-deps
npm i #aws-amplify/interactions --save --legacy-peer-deps
npm i #aws-amplify/auth --save --legacy-peer-deps
npm i #aws-amplify/api --save --legacy-peer-deps
npm i #aws-amplify/analytics --save --legacy-peer-deps
npm i #aws-amplify/xr --save --legacy-peer-deps
Do npm install aws-amplify#latest sometimes this problem happens cuz the version i think.
After stop the project and run it again.
I was facing the same errors after upgrading #aws-amplify/ui-react from 1.x to 4.x
I have tried the below steps and errors got resolved after that.
Removed node_modules and package-lock.json files.
npm install

difference between npm install react-router-dom and npm install --save react-router-dom command

difference between npm install react-router-dom and npm install --save react-router-dom command
I tried both commands and got same result so can't understand what the actual working difference between these commands
Starting from version 5 npm will save the package to your dependencies by default. For previous versions you needed --save flag to do that.
More info: https://github.com/npm/npm/issues/5108
With the advent of npm v5 or greater, by default, it will be saved without the --save flag.
Prior to npm 5, the --save command will also save the package name under the package.json file under the dependencies object.
This will ensure than if this project was to be pulled/cloned on a different computer, you can type npm install to install all the dependencies listed under the package.json.
Whereas without --save, the dependency will not be put into package.json dependencies list. And when you type npm install in a new environment, you will be missing that package.

First React application setup: Webpack has been initialised using a configuration object that does not match the API schema

I am trying to setup my first react application. I installed all the npm packages required. But getting this error.
npm uninstall webpack --save-dev
npm install webpack#2.1.0-beta.22 --save-dev

How to install latest version of fontawesome using npm in react js?

I want to use the latest fontawesome version. but i cannot install using npm. How to install the fontawesome latest version(5.0.10) using npm?
I tried like this
npm i #fortawesome/fontawesome
It will always install latest version by default. However you can force package manager to install specified version too.
Just run
npm i #fortawesome/fontawesome#5.0.10 --save
You need to add --save for it to also show up in package.json
or by using yarn
yarn add #fortawesome/fontawesome#latest
just use this command
npm i fontawesome#5.0.10 --save
You need to add --save for it to also show up in package.json
We are actually at 5.0.13 as of today. We also have some pre-release files for 5.1 that improve things quite a bit.
You can install the pre-release version like this:
npm install --save #fortawesome/fontawesome-free
If you are a Pro subscriber and you've configured NPM to use our private NPM repository you can do this:
npm install --save #fortawesome/fontawesome-pro
And finally if you want to install the latest 5.0.x version:
npm install --save #fortawesome/fontawesome-free-webfonts
or
npm install --save #fortawesome/fontawesome-pro-webfonts
Also note that everything that comes from Font Awesome officially will be under the #fortawesome scope.

Resources