Installing es6-promise with typings - angularjs

I was reading this article on Angular 2 - https://semaphoreci.com/community/tutorials/setting-up-angular-2-with-webpack
* the above article is for Angular 2 RC5.
All works smoothly until the time we get to executing this line - installing es6-promise with typescript (typings).:
./node_modules/.bin/typings install es6-promise --save
Executing this line in Terminal throws the following error:
typings WARN hastypings Typings for "es6-promise" already exist in "node_modules/es6-promise/es6-promise.d.ts". You should let TypeScript resolve the packaged typings and uninstall the copy installed by Typings
typings ERR! message Unable to find "es6-promise" ("npm") in the registry.
typings ERR! message However, we found "es6-promise" for 2 other sources: "common" and "dt"

It looks like you already have typings installed with the module, so there is no need еo do it manually. Try just to skip this step - ./node_modules/.bin/typings install es6-promise --save

I just had this same issue
The command has been changed to:
typings install dt~es6-shim --save --global
You can check this github issue for reference:
Unable to install es6 Shim or registry:env/meteor

This will work for you:
./node_modules/.bin/typings install es6-promise --source dt --save
It will import for you the requested file from DefinitelyTyped.

With the typings repo being deprecated, you would now use the following command:
npm install #types/es6-shim --save

Related

React.Js styled-components getting this error

ERROR in ./src/components/Login.js 4:0-39
Module not found: Error: Cannot find file:
'styled-components.browser.esm.js' does not match the corresponding
name on disk:
'.\node_modules\styled-Components\dist\styled-components'.
This looks like an installation problem. Run/type in command line
npm install --save styled-components
and then restart your app, by running npm start
If you use yarn, replace npm with yarn.
Let us know if the issue resolves!

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.

npm ERR! code ENOSELF while installing react dependencies

when I try to install dependencies using 'npm install react react-dom prop-types --save-dev' to the react (in webstorm) it shows an error 'npm ERR! code ENOSELF'.
it did work correctly before so i tried 2 3 times creating new projects
npm install react react-dom prop-types --save-dev
npm install react react-dom prop-types --save-dev should install all the dependencies but it shows an error
For this error,
make sure that the project name and package name should not be the same.
or just rename the package name property in my package.json in the branch...
rename your project directory to something else....
then execute below command
npm audit fix
or
npm audit fix --force

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