how can i get what version is my flux via CMD? - react-native

I have installed react-native-router-flux for my learning project. i need to know what is the exact version of that, so on my project folder I used react-native-router-flux -version but it didn't work. how can i get what version is that via CMD?

If you are using npm as a package manager, you can type npm list react-native-router-flux. Similarly, if you are using yarn you can type yarn list react-native-router-flux.

You can use yarn outdated or npm outdated to see your package that are out of date. if a package is not in this list it means that you are using the last version of that package.
By using yarn outdated you can see the current version, wanted version and the latest version of each package.

Related

npx from command line does not find imports?

I'm trying to run a simple hello.ts script from command line. This works if the script has no dependencies:
npx ts-node hello.ts
But as soon as I start adding some dependencies...
import _ from 'lodash';
console.log('hello');
It fails:
Cannot find module 'lodash' or its corresponding type declarations.
It keeps failing even if I install the dependencies globally. So how do I tell npx (or ts-node for that matter) to consider globally installed dependencies?
Update
Using Node 16.9.1 (upgraded via Version Lens). The error seems to have disappeared after uninstalling/reinstalling the imported libraries a few times.
If you're using npm >=1.0, you can use npm link to create a local link to a package already installed globally. (Caveat: The OS must support symlinks.)
IE: npm install -g lodash && npm link lodash
However, this doesn't come without its problems.
npm link is a development tool. It's awesome for managing packages on your local development box. But deploying with npm link is basically asking for problems, since it makes it super easy to update things without realizing it.
As an alternative, you can install the packages locally as well as globally.
For additional information, see:
https://nodejs.org/en/blog/npm/npm-1-0-link/
https://nodejs.org/en/blog/npm/npm-1-0-global-vs-local-installation/
Are you using the n package by any chance? I used n to change from a newer version of node (16.2.0) to an older version of node (12.13.0), ran npm i and npx failed with a different error.
Using n to change back to 16.2.0 seems to have resolved the issue so I'm thinking perhaps it was an issue with package-lock.json or such

How to check my create-nuxt-app version and upgrade it?

Background:
Previously, running yarn create nuxt-app myApp installs Nuxt v2.4.0 but today for example I noticed you downgraded to Nuxt v2.0.0. I did not change the development environment so I can not understand this behavior.
I did some search and complained elsewhere when I landed on this:
So the OP was asked to upgrade his create-nuxt-app version.
Question:
But how to do that ? How to check which create-nuxt-app I do have ?
Bonus:
I read why does Create-Nuxt-App installs nuxt version 1.4.5? and the answer says you: "Make sure you don't have a version of create-nuxt-app installed locally or globally." But how do you even install create-nuxt-app locally and globally ?
Info:
When I run npm list -g | grep 'nuxt-app' I do not get anything.
You are fine. You don't need to do anything.
If you create a project with create-nuxt-app you get "nuxt": "^2.0.0" in your package.json which means that your project automatically uses the latest 2.x.x version of nuxt. Also if there'll be an update to nuxt your project with update itself.
And to answer your two questions:
If you have create-nuxt-app installed in your project you can check its version using npm list create-nuxt-app (make sure you are in the project's directory). If it's installed globally you can check the version using npm list create-nuxt-app -g.
You can install create-nuxt-app locally using npm install create-nuxt-app and globally with npm install -g create-nuxt-app.
I finally found an answer here and there:
This execution screenshot from #manniL on Github is helpful also:
To check the existing NuxtJS Version of the project,
run yarn why nuxt on your terminal from the project root directory.
If you want to check for the VueJS version, install Vue Developer tool web extension, and check for Vue version.
source
If you have installed create-nuxt-app globally using npm, first uninstall that. Using the below command.
npm uninstall -g create-nuxt-app
Then reinstall it. And the latest version of the package will be installed.
npm install -g create-nuxt-app

Gulp version 4. Why is it not the 'latest' version?

I am working on a project which has gulp as a dependency. I am looking at updating it to gulp 4. A quick look at the output of npm show gulp#latest shows
...
dist-tags:
latest: 3.9.1 next: 4.0.0
...
I wonder why the gulp team have left latest: 3.9.1 and choose next: 4.0.0, i.e. npm install gulp installs 3.9.1 while to get 4.0.0 one has to ask for npm install gulp#next. Why is the default version still 3.9.1? Is version 4.0.0 still not fully supported or something? I have not found anything regarding this on the gulp website.
From the npm dist-tag docs:
By default, the latest tag is used by npm to identify the current
version of a package, and npm install (without any # or
# specifier) installs the latest tag. Typically, projects only
use the latest tag for stable release versions, and use other tags for
unstable versions such as prereleases.
The next tag is used by some projects to identify the upcoming
version.
By default, other than latest, no tag has any special significance to
npm itself.
In this case latest is 3.x.x and next is 4.x.x As it is following semver, it means that there are backwards incompatible changes. If you check gulpjs.com, the link to the documentation brings you to the 3.x.x docs. It's the authorative version at the moment as set by the gulp maintainers.

Is npm install package#latest stable or does it also include alpha/beta version?

I just want some confirmation as I've always been using #latest for a while with my packages and want to know if I'm really installing a stable version or can possibly install a alpha/beta version of the package.
I'm pretty sure this is meant for stable versions as they tell you to install#latest for npm (unless it's special syntax like npm start).
The more I think about it, the more paranoid I get, any confirmation would be greatly appreciated. :)
Using npm install <pkg>#latest is equivalent to using npm install <pkg> by itself or listing * as the dependency version in package.json. npm documents this here:
npm install will use the latest tag by default.
So in practical terms, latest is semantically equivalent to stable.
However, if a prerelease version of a package is published to npm without specifying a prerelease tag such as --beta or --rc, that version becomes the latest by default:
By default, npm publish will tag your package with the latest tag.
As a result, it's possible to mess up and publish a prerelease version that will be installed by default. This happened to Bootstrap in late 2015.
This article from early 2016 by Mike Bostock explains how even specifying alpha or beta as part of the version number won't prevent npm from making that version the latest.
So unfortunately if you want to be certain that you get only stable versions, you need to monitor this manually or trust the package developers to always specify a prerelease tag for non-stable versions.
You can also view the tags assigned for a package like this:
$ npm view express dist-tags
{ latest: '4.16.2', rc: '4.0.0-rc4' }

Q: react-native init creates a .flowconfig file which requires flow version 0.25.0 but I have flow 0.26.0 installed

If I tried changing the .flowconfig file to use 0.26.0, flow finds a bunch of errors in the react-native node module. My react-native is version 0.27.2.
Is there a way I can install flow 0.25.0?
You can install it from here. https://github.com/facebook/flow/releases
You can find every release on this page.
You can also install it from here https://www.npmjs.com/package/flow-bin. Just run npm i flow-bin#0.25.
I don't however know the way to install previous version of flow from Homebrew.