How to upgrade react-leaflet from v.2.8 to v.3 - react-leaflet-v3

I'm using react-leaflet v.2.8 in my project. I want to upgrade the react-leaflet to v.3. But how? When I write "npm i react-leaflet", it installed only react-leaflet v.2.8.

One way:
npm uninstall react-leaflet
npm install react-leaflet
Another way:
Go to your package.json, and change whatever version number react-leaflet has to the latest one that is listed on npm. It should then look like this in the package.json:
"react-leaflet": "^3.2.0"
Then run npm install react-leaflet
Keep in mind there are lots of breaking changes from version 2 to version 3, so be prepared to update your codebase.

Related

vips/vips8 file not found #include <vips/vips8> in Ionic cordova in IOS

I found an error in sharp.
After that, I found a blog in which they ask to delete sharp from the node module and run sudo npm i.
I have gone through GitHub and write minipass - 2.7.0
After that, I got a new error in
vips/vips8 file not found #include <vips/vips8>
I'm using Ionic with Angular on Macbook
I use commands which is
1.sudo npm install
2.sudo npm i gulp-sass -ES --unsafe-perm=true
3.sudo ionic cordova platform add ios
I very recently ran into a similar issue after making some changes to a project's package.json on my Mac (not an Angular or Cordova project).
I came across this GitHub issue for the sharp package which mentioned you may need to update the globally-installed version of libvips: https://github.com/lovell/sharp/issues/1148
In my case, since I use Homebrew but had not directly installed this package previously, I was able to resolve by running brew install vips and then re-running npm install. Note that it has a lot of dependencies so installation may take some time.
Edit: if that doesn't work, you may need to try a fresh install by removing node_modules, then re-running npm i.
This might be not applicable to everyone, but remove package-lock.json and node_modules directory first and then try npm install again. (I also added the minipass in my package.json, by the way)
In my case, I had encountered the same error, but I could solve it by doing the above.

Homebrew install the old version of flow

I cd to my react-native project directory, and run flow, it prompts me Launching Flow server for /Users/... Wrong version of Flow. The config specifies version ^0.32.0 but this is version 0.33.0. How do I install the previous version flow with Homebrew?
If you run brew info flow in the console, you'll see a line similar to the following:
flow: stable 0.33.0 (bottled), HEAD
This means that the person managing the flow homebrew formula is removing old versions as the version gets updated, so it's impossible for you to access any old versions, barring performing some behind the scenes business I'm unaware of.
Luckily, there's a solution for you. I assume you're using npm, in which case you can try the following:
npm install flow-bin#0.32 -g
This will install a binary wrapper for flow, packaged through npm, in which previous versions are all available. By installing globally, you can use the flow commands in the command line.
If you don't want to install globally, for fear of conflicting with other projects, etc., you can still install locally and use flow:
npm install flow-bin#0.32
Now, add the following to package.json:
"scripts": {
...
"flow": "flow ."
},
And now, you'll be able to run flow on your project with the command:
npm run flow

How to make JSPM install Bower dependencies

For a while now, my client has been using some Node and Bower components to build projects. Whenever a new developer comes in, it's easy for that person to simply run
npm install
bower install
And then be ready to work.
We are working on a new project and this time we want to use JSPM instead of Bower. However, we want to leverage our existing private libraries (20+ of them) and we don't want to spend stupid amounts of time rewriting them. Plus they still need to work as regular Bower components for other projects.
So far, this worked. We used jspm-git to set the registry. However, JSPM fails in one regards: it does not install the Bower dependencies of those libraries it installed.
How would we go about that? I would love the other devs in the team to be able to check out the project and run
npm install
jspm install
And be on their way. It doesn't seem possible so far. Any set up we have forgotten? Any guidance will be greatly appreciated.
You need the jspm bower endpoint:
npm install jspm-bower-endpoint --save-dev
Then you need to register the bower endpoint with jspm:
jspm registry create bower jspm-bower-endpoint
Then you can install bower packages:
jspm install bower:angular-bootstrap-multiselect
Hope this helps :)
Just installed it successfully with jspm install npm:bootswatch, then required it in code with <require from="bootswatch/slate/bootstrap.min.css"></require>
Also posted this info on the bootswatch-dist project on github here: https://github.com/dbtek/bootswatch-dist/issues/32

Using "npm install" to install jquery-ui

I see from here https://github.com/jquery/jquery-ui that jquery-ui's latest release is 1.11.4. However, when I use "npm install jquery-ui", it's only 1.10.3. I checked this version in node_modules/jquery-ui/jquery-ui.js.
Is there any way for me to install the latest version?
jQuery-ui specifically needs to be build after installation. To avoid this, use npm install jquery-ui-dist
T J gave the right answer, but it is a bit short / too generic.
The GitHub project is at https://github.com/jquery/jquery-ui/
So the real command would be npm install github:jquery/jquery-ui (you can even skip github: as npm defaults to it).
But this would bring you the latest, unstable version (around 1.12 at time of writing), and it didn't even work when I tried.
So it is better to fetch a tagged version:
npm install github:jquery/jquery-ui#1.11.4
Generic note: AFAIK, if the project hasn't a package.json file, this kind of install can still fail.
Here is the current latest version (1.11.4), same package that bower is using, including all themes.
npm install github:components/jqueryui#1.11.4
You can install it like
npm install github:mygithubuser/myproject
as mentioned in the install documentation

Managing bower dependencies with ionic

After starting with a new ionic app, I can see at bower.json that comes with ionic is in devdependencies. Why is it a devdependency and not a normal dependency?
"devDependencies": {
"ionic": "driftyco/ionic-bower#1.0.0-rc.0"
},
Thanks, I feel confused right now
having devDependencies gives you the opportunity to simplify the steps that drive you from the source files (a git clone of the project) to the production ready app
when you don't need to make changes and (develop) the application, you could just run
bower install --production
or
npm install --production
they work the same
bower install options
-F, --force-latest: Force latest version on conflict
-p, --production: Do not install project devDependencies
-S, --save: Save installed packages into the project’s bower.json dependencies
-D, --save-dev: Save installed packages into the project’s bower.json devDependencies
-E, --save-exact: Configure installed packages with an exact version rather than semver
bower documentation
npm install options
By default, npm install will install all modules listed as
dependencies. With the --production flag (or when the NODE_ENV
environment variable is set to production), npm will not install
modules listed in devDependencies.
npm documentation
This way you take less time to ship the app and don't waste bandwidth downloading stuff you won't need.
Given that, to me, the choice of listing ionic as devDependecy is a poor one: it implies that I could take advantage of this choice to get ready the app for execution this way:
git clone my-project
git cd my-project
npm install --production # ionic not installed here
ionic state restore
ionic build ios
Now, if you ignore the content of /lib folder in your sources, this should not work, and if it works because the ionic-cli does some more checks to save your ass, I think this is unclear.
From what I understand, dependencies are required to run, and devDependencies are only for development, like minification, unit tests, etc.
Both will install when you do npm install but only dependencies will install when you do npm install $package, unless you add the --dev option

Resources