angular-file-saver is not installed - angularjs

Hi All Experts of Angularjs
I am using bower install for my angular project
"file-saver.js": "^1.20150507.2",
"angular-file-saver": "^1.1.3",
I am getting error when bower install, FileSaver repository not found, I checked it in GitHub, This repository really was gone away.
https://github.com/Teleborder/FileSaver.js.git#~1.20150507.2
Help me!!! How can I fix this issue.

same problem here. Just make this changes:
Add to your .bowerrc
"ignoredDependencies": [
"file-saver.js"
]
Then in bower.json
"dependencies": {
...
"file-saver": "2.0.4",
...
},
"overrides": {
...
"angular-file-saver": {
"dependencies": {},
"main": ["dist/angular-file-saver.js"]
},
"file-saver": {
"main": "dist/FileSaver.js"
},
...
}

Unable to resolve file-saver.js dependency file from bower install angular-file-saver
This article will solve your problem.
I faced same problem and solved it.

Related

Yarn workspace, react, monorepo issue with conflict library version

I'm experimenting with yarn workspace monorepo. It is consisting of a TestProject created with create-react-app, and a SharedLib1 which is created with create-react-library. TestProject imports code from SharedLib1. The problem being, TestProject uses react-scripts 3.3.0 which is dependent on babel-jest ^24.9.0, while SharedLib1 uses react-scripts-ts ^2.16.0 which is dependent on babel-jest 22.4.4. When running yarn start in TestProject, it complains:
The react-scripts package provided by Create React App requires a dependency:
"babel-jest": "^24.9.0"
Don't try to install it manually: your package manager does it automatically.
However, a different version of babel-jest was detected higher up in the tree:
/monoRepo/node_modules/babel-jest (version: 22.4.4)
I could disable the error by setting SKIP_PREFLIGHT_CHECK=true in TestProject or manually upgrade the react-scripts inside SharedLib1, but I'd like to know if there's a better way of handling this.
myMonorepo
-web
-SharedLib1
-package.json
-TestProject
-package.json
-package.json
Package.json of myMonoRepo:
{
"name": "my-mono-repo",
"version": "0.1.0",
"private": true,
"workspaces": [
"web/*"
],
"nohoist": [
"**/babel-jest",
"**/babel-jest/**"
]
}
Package.json of myMonoRepo:
{
"name": "test-proj",
"version": "0.1.0",
"private": true,
"dependencies": {
...
"shared-lib-1": "^1.0.0"
}
}
And the test code App.tsx:
import React from 'react';
import TestComp from 'shared-lib-1';
import './App.css';
const App: React.FC = () => {
return (
<div className="App">
<TestComp text={'aaa'}/>
Learn React
</div>
);
}
export default App;
There is a babel-jest 24.9.0 inside the node_modules of TestProj and another 22.4.4 inside the node_modules of myMonoRepo
This is very similar, if not the same, to an issue opened on the GH repo for create-react-app and you may find additional information there.
That said, you might try moving babel-jest to a devDependency instead of a package dependency. If that does not work, you might try Selective dependency resolutions, where you can force your project to a specific version of babel-jest -
"resolutions": {
"babel-jest": "^24.9.0",
"shared-lib-1": "^1.0.0"
}

31.0.0 is not a valid SDK Version. Options are 32.0.0 UNVERSIONED

I am unable to run my app on my simulator as well as device.Earlier it was working.
I have tried every step mentioned in this blog
Official Blog for updation
My package.json is
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"android-windows": "react-native bundle --platform android --dev false --entry-file App.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res && react-native run-android",
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"eject": "expo eject",
"debugWindow": "start 'rndebugger://set-debugger-loc?host=localhost&port=8081'",
"debugLinux": "open 'rndebugger://set-debugger-loc?host=localhost&port=8081'"
},
"dependencies": {
"expo": "^31.0.4",
"react": "16.5.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-31.0.1.tar.gz",
"react-navigation": "^3.0.8"
},
"devDependencies": {
"babel-preset-expo": "^5.0.0"
},
"private": true
}
And App.json is
{
"expo": {
"name": "AwesomeProject",
"slug": "AwesomeProject",
"privacy": "public",
"sdkVersion": "31.0.0",
"platforms": [
"ios",
"android"
],
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true
}
}
}
I have tried running npm install 2-3 times but nothing seems to work.
I can't understand why its been suggesting option 32.0.0 when there is no release notes for this option at this link.
Upgrading Expo
This is a known issue https://github.com/expo/expo/issues/3112
It is due to the Expo application from the Play Store having a bug. If you are using v2.10.0 then you should upgrade to v2.10.1
https://github.com/expo/expo/issues/3112#issuecomment-451697372
Sorry guys for the trouble 😞 We've fixed this issue in v2.10.1 that
was released just a few hours later so you should already have an
update.
https://play.google.com/store/apps/details?id=host.exp.exponent&hl=en
WHAT'S NEW
Fix issues when loading experiences with SDK older than 32
You can downgrade it by changing those files that refer to version 32 to the one that your mobile supports like 28:
app.json :
"sdkVersion": "32.0.0" → "sdkVersion": "28.0.0"
package.json :
"expo": "^32.0.0", → "expo": "28.0.0"
"react-native": ".../sdk-32.0.0.tar.gz", → "react-native": ".../sdk-28.0.0.tar.gz"
"jest-expo": "^32.0.0" → "jest-expo": "28.0.0"
try updating your expo application from the play store. It worked for me.
Here is how I fixed mine in case any of the above answers don't work for you.
Open up your app.json and sdkVersion. It was 33.0.0 before upgrading it as below fix the issue.
"sdkVersion": "35.0.0"
This fixed it for me:
Run expo update 35.0.0. (Replace version with your desired version. 35.0.0 is the latest as of this post.) This updates expo, by updating app.json & package.json and installing the latest dependencies.
Referenced from:
https://docs.expo.io/versions/latest/workflow/upgrading-expo-sdk-walkthrough/
Also, check that:
your expo app is the latest version through the app/play store.
your expo cli is the latest version npm install -g expo-cli
If you have run expo update 35.0.0 or other version and it did not solve the error, and if you had ejected your expo project...
Check if you have the right detach properties in your app.json. Note the sdk number on the URL for both iosExpoViewURL and androidExpoViewURL keys.
"detach": {
"iosExpoViewUrl": "https://s3.amazonaws.com/exp-exponent-view-code/ios-v2.13.0-sdk35.0.0-a30ebc9b-3db4-42f4-b677-e468076baf18.tar.gz",
"androidExpoViewUrl": "https://s3.amazonaws.com/exp-exponent-view-code/android-v2.13.0-sdk35.0.0-b816b7af-88da-4ca9-87a5-7438f0c21b6e.tar.gz"
}
try
expo update
Its Working on my case :)
Clear all data and cache of Expo app on your android device. It works for me.
if you are using the Expo app, update them, because the SDK is not are updated
I updated it, and it worked :)
In your package.json
change from
"expo": "^31.0.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-31.0.0.tar.gz",
To
"expo": "^32.0.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz",
Delete node_module folder and package-lock.json file
Then run
npm i

React Storybook Fails on Demo

I'm attempting to use React Storybook in a project that already has an extensive Webpack 2 config. I started the Storybook following the basic steps:
npm i -g #storybook/cli
getstorybook
When I run yarn storybook, it breaks on the JSX of the demo component:
ERROR in ./stories/index.jsx
Module parse failed: /Users/alexanderhadik/project/web/node_modules/#storybook/react/node_modules/babel-loader/lib/index.js??ref--0!/Users/alexanderhadik/project/web/stories/index.jsx Unexpected token (9:55)
You may need an appropriate loader to handle this file type.
| import { Button, Welcome } from '#storybook/react/demo';
|
| storiesOf('Welcome', module).add('to Storybook', () => <Welcome showApp={linkTo('Button')} />);
|
| storiesOf('Button', module)
# ./.storybook/config.js 4:2-23
# multi ./node_modules/#storybook/react/dist/server/config/polyfills.js ./node_modules/#storybook/react/dist/server/config/globals.js ./node_modules/webpack-hot-middleware/client.js?reload=true ./.storybook/config.js
Since I didn't start this project originally using create-react-app - do I need to modify the Storybook webpack config to enable JSX?
This might to be a problem with Storybook not replicating webpack babelrc behaviour exactly.
In my case, I had an empty (just {}) .babelrc file with all the important react/jsx plugins defined in webpack.config.js. Storybook read the .babelrc instead of using the babel settings in webpack.config.js.
Deleting the .babelrc solved that issue.
in my case, i didnt have a .babelrc at all -- i used the entry "babel" in the package.json. when running the storybook in this project, the babel entry wasnt there. i added it and things magically started working.
{
"name": "root",
"private": true,
"devDependencies": {
"#storybook/addon-actions": "^4.1.11",
"#storybook/addon-links": "^4.1.11",
"#storybook/addons": "^4.1.11",
"#storybook/react": "^4.1.11",
...
},
"dependencies": {},
"scripts": {
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook"
},
"babel": {
"presets": [
"#babel/preset-env",
"#babel/preset-react"
]
}
}
i hope this helps someone.

Why does Bower say Angular depends on random things?

I am trying to install a package, for instance bower install restangular --save
Then Bower asks me to choose an Angular version:
> Unable to find a suitable version for angular, please choose one:
> 1) angular#1.2.6 which resolved to 1.2.6 and has ang-changeorg, angular-cookies#1.2.6, angular-mocks#1.2.6, angular-resource#1.2.6,
> angular-sanitize#1.2.6, angular-scenario#1.2.6 as dependants
> 2) angular#1.2.17-build.226+sha.b6388b3 which resolved to 1.2.17-build.226+sha.b6388b3 and has angular-animate#1.2.17-build.226+sha.b6388b3 as dependants
> 3) angular#* which resolved to 1.2.18 and has restangular#1.4.0 as dependants
> 4) angular#~1.2.0 which resolved to 1.2.19-build.258+sha.ea653e4 and has angularfire#0.7.1 as dependants
> 5) angular#>= 1.0.8 which resolved to 1.3.0-build.2845+sha.e57ad6a and has angular-ui-router#0.2.10 as dependants
>
> Prefix the choice with ! to persist it to bower.json
In these options ang-changeorg is another project I've worked on locally, has no relation to my current working directory.
My bower.json for the current project looks like so:
{
"name": "ang-changeorg",
"version": "0.0.0",
"appPath": "public",
"dependencies": {
"angular": "1.2.6",
"json3": "~3.2.6",
"es5-shim": "~2.1.0",
"jquery": "~1.10.2",
"bootstrap": "~3.0.3",
"angular-resource": "1.2.6",
"angular-cookies": "1.2.6",
"angular-sanitize": "1.2.6",
"firebase": "~1.0.11",
"angularfire": "~0.7.1",
"spin.js": "~2.0.0",
"angular-ui-router": "~0.2.10",
"angular-animate": "~1.2.16",
"ng-file-upload": "~1.4.0"
},
"devDependencies": {
"angular-mocks": "1.2.6",
"angular-scenario": "1.2.6"
},
"resolutions": {
"angular": "1.2.6"
}
}
bower cache clean did not resolve this.
Why does bower list ang-changeorg as a dependent? Clarity on how these angularjs version dependents work would be awesome.
It's because in your bower.json, the name of your project is ang-changeorg
{
"name": "ang-changeorg",
"version":
And all the dependencies in that file
"dependencies": {
"angular": "1.2.6",
"json3": "~3.2.6",
"es5-shim": "~2.1.0",
"jquery": "~1.10.2",
...
are the ones "name": "ang-changeorg" are dependent to.
Therefore ang-changeorg is dependent to angular#1.2.6 because the version 1.2.6 of angular is specified in your bower file:
"dependencies": {
"angular": "1.2.6",
Each package listed in your bower.json file has it's own bower.json file which lists another set of dependencies.
So, when it says that ang-changeorg has angular#1.2.6 as a dependant, that's because the ang-changeorg package has angular#1.2.6 listed in it's bower.json file.
Consider upgrading to latest Angular 1.2.18 in all of your Bower calls, you've got some mixed dependencies and most likely Restangular would prefer the latest or at least matching with the latest version ("angular-animate": "~1.2.16").
I don't think you'll see any breaking changes.

Strange angular version resolving bug with bower install

I'm trying to update my angular version, and I think bower went just mad.
My deps :
"dependencies": {
"underscore":"*",
"momentjs":"~2.2.1",
"bootstrap": "~3.0.0",
"jquery": "~1.9.1",
"jquery.cookie": "*",
"jquery-ui": "~1.10.3",
"jquery-file-upload": "*",
"angular": "~1.2.0-rc.2",
"angular-route": "~1.2.0-rc.2",
"angular-resource": "~1.2.0-rc.2",
"angular-animate": "~1.2.0-rc.2",
"angular-cookies": "~1.2.0-rc.2",
"angular-i18n": "~1.2.0-rc.2",
"angular-bootstrap" : "*",
"ng-grid": "*",
"highcharts": "*",
"highcharts-ng": "*"
},
"devDependencies": {
"angular-mocks": "~1.2.0-rc.2",
"angular-scenario": "~1.2.0-rc.2"
}
the important thing here is : all angular modules are version 1.2.0-rc.2
But when doing
bower install
here is the result :
Unable to find a suitable version for angular, please choose one:
1) angular#1.0.8 which resolved to 1.0.8 and has angular-scenario#1.2.0-rc.2 as dependants
2) angular#1.2.0-rc.2 which resolved to 1.2.0-rc.2 and has angular-animate#1.2.0-rc.2, angular-cookies#1.2.0-rc.2, angular-mocks#1.2.0-rc.2, angular-resource#1.2.0-rc.2, angular-route#1.2.0-rc.2, angular-scenario#1.2.0-rc.2 as dependants
3) angular#~1.2.0-rc.2 which resolved to 1.2.0-rc.2 and has tael-web as dependants
4) angular#>=1 which resolved to 1.2.0-rc.2 and has angular-bootstrap#0.6.0 as dependants
5) angular#>=1.0.4 which resolved to 1.2.0-rc.2 and has highcharts-ng#0.0.2 as dependants
bower seems to think that angular-scenario 1.2.0-rc2 requires angular 1.0.8 ... ???
which is actually just false : https://github.com/angular/bower-angular-scenario/tree/v1.2.0-rc.2
bower.json :
{
"name": "angular-scenario",
"version": "1.2.0-rc.2",
"main": "./angular-scenario.js",
"dependencies": {
"angular": "1.2.0-rc.2"
}
}
What I am missing here ? What can I do to resolve this ? To be clear : I dont want to use the interactive conflict resolving method, because this is appening on a remote CI. I just want to underscore how the * assume angular scenario 1.2.0-rc2 as angular 1.0.8 as dependency...
thanks
Try adding this section to your bower.json:
"dependencies": {
...
},
"resolutions":{
"angular": "1.2.0-rc.2"
}
Note: angular version in resolutions as same as version in dependencies.
I got the same problem with the latest bower version.
You can just do as the bower output prompts: Prefix the choice with ! to persist it to bower.json to choose one from the options provided. Then your bower.json will be updated with an additional "resolutions": { ... } block then the problem will be solved.
Instead of:
"angular": "~1.2.0-rc.2"
Try:
"angular": "=1.2.0-rc.2"
Might not be the right way to do it however but it solved a similar issue in my project.

Resources