Cannot install angular-cache to my ionic project - angularjs

I tried to create a new project using the following command
ionic start BlankApp blank
to create a blank app from Blank templates
Next I run
bower install --save angular-cache
and the installing process stop at
bower angular#>=1.x validate 1.5.6 against https://github.com/angular/bower-angular.git#>=1.x
So I tried using
npm install --save angular-cache
It create a folder named "node_modules" and the following error
ionic-project#1.1.1 /Users/Thipok/Desktop/ProjectSth/Cache-Local
├── UNMET PEER DEPENDENCY angular#>=1.x <2
└── angular-cache#4.6.0
npm WARN angular-cache#4.6.0 requires a peer of angular#>=1.x <2 but none was installed.
npm WARN ionic-project#1.1.1 No repository field.
npm WARN ionic-project#1.1.1 No license field.
I also tried to install cordova-plugin-wkwebview and failed but that is not the question here.

Related

Fix the upstream dependency conflict, react-share with React 18, Deployment failed in Netlify

Unable to install react-share on React 18 project and failed deployment on Netlify
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16.3.0 || ^17" from react-share#4.4.0
npm install --save --legacy-peer-deps react-share
First, utilize the advised command npm install --save --legacy-peer-deps react-share
then, in your app root directory create a .npmrc file
lastly add to the file legacy-peer-deps=true
and you're ready to deploy.
The --legacy-peer-deps flag was introduced with v7 as a way to bypass peerDependency auto-installation; it tells NPM to ignore peer deps and proceed with the installation anyway.
npmrc is the configuration file that npm allows to be used globally or user level or project level to optimize your npm environment. npmrc can be configured in four different locations. Globally. Per user. Per project.

Angular 4 project ng build --prod fail

My Angular project is #Angular4.0.0.
Angular CLI: 1.7.4
Node: 6.9.5
I'm getting the following errors while trying to run npm install and ng build --prod.
npm install errors
UNMET PEER DEPENDENCY bootstrap#4.0.0-alpha.6
UNMET PEER DEPENDENCY firebase#4.13.1
ng build --prod error
ERROR in scripts.0cfd151de42187092cb0.bundle.js from UglifyJs undefined
Please anyone help me to resolve this problem.?
It has missing peer dependencies, install the peer dependencies yourself. for example:
npm install bootstrap firebase
for your problem that should be: npm install bootstrap#4.0.0 npm install --save firebase#4.13.1

react-qr-reader installation issue with REACT

I'm trying to install react-qr-reader from https://github.com/JodusNodus/react-qr-reader. I installed REACT and REACT dom just fine but after I added the react-qr-reader package I get this:
root#server [~]# npm install --save react-qr-reader
npm WARN react-qr-reader#2.0.1 requires a peer of react#^15.0.2 but none is installed. You must install peer dependencies yourself.
npm WARN react-qr-reader#2.0.1 requires a peer of react-dom#^15.0.2 but none is installed. You must install peer dependencies yourself.
npm WARN root#1.0.0 No description
npm WARN root#1.0.0 No repository field.
How can I identity the missing peer?
When I try and load the js script I get an "Uncaught SyntaxError: Unexpected identifier" at that line: "import React, { Component } from 'react'". So I'm assuming PEAR is not even properly installed.
First you need to install react and react-dome
npm i react react-dom
Then try install react-qr-reader with sudo command
sudo npm i react-qr-reader --save
npm i react-qr-reader --force
use This its definitely Work For You

NPM transitive dependencies do not work for Angular [duplicate]

For example, when I install Angular2:
npm install --save angular2
temp#1.0.0 /Users/doug/Projects/dougludlow/temp
├── angular2#2.0.0-beta.3
├── UNMET PEER DEPENDENCY es6-promise#^3.0.2
├── UNMET PEER DEPENDENCY es6-shim#^0.33.3
├── UNMET PEER DEPENDENCY reflect-metadata#0.1.2
├── UNMET PEER DEPENDENCY rxjs#5.0.0-beta.0
└── UNMET PEER DEPENDENCY zone.js#0.5.11
npm WARN angular2#2.0.0-beta.3 requires a peer of es6-promise#^3.0.2 but none was installed.
npm WARN angular2#2.0.0-beta.3 requires a peer of es6-shim#^0.33.3 but none was installed.
npm WARN angular2#2.0.0-beta.3 requires a peer of reflect-metadata#0.1.2 but none was installed.
npm WARN angular2#2.0.0-beta.3 requires a peer of rxjs#5.0.0-beta.0 but none was installed.
npm WARN angular2#2.0.0-beta.3 requires a peer of zone.js#0.5.11 but none was installed.
Is there a magic flag that I can pass to npm that will install the peer dependencies as well? I haven't been able to find one... It's tedious to manually copy and paste the peer dependencies and make sure I have the correct versions.
In other words, I'd rather not have to do:
npm install --save angular2#2.0.0-beta.3 es6-promise#^3.0.2 es6-shim#^0.33.3 reflect-metadata#0.1.2 rxjs#5.0.0-beta.0 zone.js#0.5.11
What is the better way?
npm version 7 and newer
npm v7 has reintroduced the automatic peerDependencies installation. Now in V7, as in versions before V3, you only need to do an npm i and all peerDependences should be automatically installed.
They had made some changes to fix old problems as version compatibility across multiple dependants.
You can see the discussion and the announcement.
Older Answer
The automatic install of peer dependencies was explicitly removed with npm 3, as it cause more problems than it tried to solve. You can read about it here for example:
https://blog.npmjs.org/post/110924823920/npm-weekly-5
https://github.com/npm/npm/releases/tag/v3.0.0
So no, for the reasons given, you cannot install them automatically with npm 3 upwards.
I solved it by rewriting package.json with the exact values warnings were about.
Warnings when running npm:
npm WARN angular2#2.0.0-beta.3 requires a peer of es6-shim#^0.33.3 but none was installed.
npm WARN angular2#2.0.0-beta.3 requires a peer of reflect-metadata#0.1.2
In package.json, write
"es6-shim": "^0.33.3",
"reflect-metadata": "0.1.2",
Then, delete node_modules directory.
Finally, run the command below:
npm install
Cheat code helpful in this scenario and some others...
├── UNMET PEER DEPENDENCY #angular/common#4.0.2
├── UNMET PEER DEPENDENCY #angular/compiler#4.0.2
├── UNMET PEER DEPENDENCY #angular/compiler-cli#4.0.2
├── UNMET PEER DEPENDENCY #angular/core#4.0.2
├── UNMET PEER DEPENDENCY #angular/forms#4.0.2
├── UNMET PEER DEPENDENCY #angular/http#4.0.2
├── UNMET PEER DEPENDENCY #angular/platform-browser#4.0.2
├── UNMET PEER DEPENDENCY #angular/platform-browser-dynamic#4.0.2 >
copy & paste your error into your code editor.
Highlight an unwanted part with your curser. In this case ├── UNMET PEER DEPENDENCY
Press command + d a bunch of times.
Press delete twice. (Press space if you accidentally highlighted ├── UNMET PEER DEPENDENCY )
Press up once. Add npm install
Press down once. Add --save
Copy your stuff back into the cli and run
npm install #angular/common#4.0.2 #angular/compiler#4.0.2 #angular/compiler-cli#4.0.2 #angular/core#4.0.2 #angular/forms#4.0.2 #angular/http#4.0.2 #angular/platform-browser#4.0.2 #angular/platform-browser-dynamic#4.0.2 --save
I experienced these errors when I was developing an npm package that had peerDependencies. I had to ensure that any peerDependencies were also listed as devDependencies. The project would not automatically use the globally installed packages.
The project npm-install-peers will detect peers and install them.
As of v1.0.1 it doesn't support writing back to the package.json automatically, which would essentially solve our need here.
Please add your support to issue in flight: https://github.com/spatie/npm-install-peers/issues/4
I was facing the same issue, lucky I found an alternative way to install peer dependencies along with the install command.
Step 1: $ npm i npm-install-peers -D
for more clarity about the plugin: https://www.npmjs.com/package/npm-install-peers
Step 2: Update package.json for magical script
....
"scripts": {
...
"postinstall": "npm-install-peers"
},
....
Step 3: Just need to hit the install command to get installed all plugins
$ npm install
Install yarn and then run:
yarn global add install-peerdeps

Successful yeoman generator install can't be found when running yo?

Currently failing to learn how to use terminal as a development tool.
Trying to set up the MEAN stack by using yeoman to scaffold the project. However, when I run npm install -g generator-angular-fullstack it installs successfully here (/Users/xxxx/npm/lib/node_modules) and then when I run yo angular-fullstack it says I haven't got that generator.
I have two generators installed already but the new generator (angular-fullstack) isn't adding to the list even though the global install was successful:
mean
meanjs
This might be irrelevant but when I try and uninstall these generators I get this message - npm WARN uninstall not installed in /Users/xxxx/npm/lib/node_modules
What I'm trying to do is:
1. install the angular-fullstack generator
2. scaffold a project using angular-fullstack
I've tried uninstalling yeoman, npm, clearing npm cache and all sorts of things but I can't get it to work. I've been working on this on and off for about 3 weeks now and all I want to do is get a mean project structure set up and running. So if anyone can help that'd be great.
Being a rookie I didn't want to resort to Stack Overflow, but I'll take the abuse now. ;)
Thanks in advance.
UPDATE: Tried to install a different generator (angular) and can't access this either. This is the message I get when installing.
~:TestMVCApp xxxx$ npm install -g generator-angular
npm WARN peerDependencies The peer dependency generator-karma#>=0.9.0 included from generator-angular will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN deprecated CSSselect#0.4.1: the module is now available as 'css-select'
npm WARN deprecated CSSwhat#0.4.7: the module is now available as 'css-what'
npm WARN peerDependencies The peer dependency yo#>=1.0.0 included from generator-karma will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
generator-karma#1.0.0 /Users/xxxx/npm/lib/node_modules/generator-karma
├── sorted-object#1.0.0
├── underscore#1.8.3
└── yeoman-generator#0.19.2 (detect-conflict#1.0.0, read-chunk#1.0.1, diff#1.4.0, yeoman-welcome#1.0.1, xdg-basedir#1.0.1, user-home#1.1.1, rimraf#2.4.3, async#0.9.2, mime#1.3.4, text-table#0.2.0, class-extend#0.1.2, dargs#4.0.1, shelljs#0.4.0, debug#2.2.0, nopt#3.0.4, istextorbinary#1.0.2, cross-spawn#0.2.9, mkdirp#0.5.1, chalk#1.1.1, yeoman-assert#1.0.0, cli-table#0.3.1, run-async#0.1.0, mem-fs-editor#1.2.3, through2#0.6.5, underscore.string#3.2.2, glob#5.0.15, findup-sync#0.2.1, yeoman-environment#1.2.7, sinon#1.17.1, github-username#1.1.1, dateformat#1.0.11, pretty-bytes#1.0.4, gruntfile-editor#1.0.0, lodash#3.10.1, inquirer#0.8.5, html-wiring#1.2.0, download#4.4.0)
generator-angular#0.12.1 /Users/xxxx/npm/lib/node_modules/generator-angular
├── chalk#1.1.1 (escape-string-regexp#1.0.3, ansi-styles#2.1.0, supports-color#2.0.0, strip-ansi#3.0.0, has-ansi#2.0.0)
├── yosay#1.0.5 (ansi-regex#1.1.1, ansi-styles#2.1.0, word-wrap#1.1.0, strip-ansi#2.0.1, pad-component#0.0.1, minimist#1.2.0, taketalk#1.0.0, string-width#1.0.1, repeating#1.1.3)
├── wiredep#2.2.2 (propprop#0.3.0, minimist#1.2.0, lodash#2.4.2, chalk#0.5.1, through2#0.6.5, glob#4.5.3, bower-config#0.5.2)
└── yeoman-generator#0.16.0 (diff#1.0.8, dargs#0.1.0, isbinaryfile#2.0.4, debug#0.7.4, async#0.2.10, mime#1.2.11, rimraf#2.2.8, findup-sync#0.1.3, text-table#0.2.0, mkdirp#0.3.5, lodash#2.4.2, iconv-lite#0.2.11, underscore.string#2.3.3, shelljs#0.2.6, class-extend#0.1.2, chalk#0.4.0, glob#3.2.11, file-utils#0.1.5, cheerio#0.13.1, request#2.30.0, inquirer#0.4.1, download#0.1.19)
First, you'll need to install globally yeoman and these required tools:
npm install -g yo bower grunt-cli gulp

Resources