How do i downgrade expo and install a specific package? - reactjs

Some of your project's dependencies are not compatible with currently installed expo package version:
- #react-native-community/netinfo - expected version range: 5.5.1 - actual version installed: ^5.8.0
Your project may not work correctly until you install the correct versions of the packages.
To install the correct versions of these packages, please run: expo install [package-name ...]
Im getting this above warning. is there any cli command to do install specific expo package? if yes then please provide it. Thanks.

Into your package.json file, update the version of #react-native-community/netinfo to the right one (5.5.1), and make a npm install again.
You can also provide the version by using the cli command :
npm i #react-native-community/netinfo#5.5.1

Related

React-native-reanimated: Unable to resolve "./useValue"

I am trying to build a react native app. I have caught an error on the terminal saying
Unable to resolve "./useValue" from "node_modules\react-native-reanimated\src\Animated.js"
I reinstalled react-native-reanimated to the expected version range.
`Some of your project's dependencies are not compatible with currently installed expo package version:
react-native-reanimated - expected version range: ~1.9.0 - actual version installed: ^1.10.1
Your project may not work correctly until you install the correct versions of the packages. To install the correct versions of these packages, please run: expo install [package-name ...]`
Thus, I run the code as follow: npm install react-native-reanimated#1.9.0, but still run into the error code.
I could realy use some help on this.
try uninstalling the package ==> close ide (all instances) ==> open the ide ==> install the package again ==> run "expo start -c"
Only do this:
expo start --clear
From Expo Documentation at Expo Start command.
--clear, -c | Clear the React Native Packager cache.

create-react-app starting error - Error: No valid exports main found for '\node_modules\colorette'

When installing create-react-app, I get this error when I start the development server (npm start):
./src/index.css (./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-3-1!./node_modules/postcss-loader/src??postcss!./src/index.css)
Error: No valid exports main found for 'myproject\node_modules\colorette'
I've reinstalled create-react-app globally with create-react-app -g and tried running it with npx, but I still get this error.
Is there anything else I can do?
Fixed this problem by upgrading node.js to v14.5, i've had v13.5 and v13.6 in my laptop.
and also removing create-react-app globally:
npm uninstall -g create-react-app
and using:
npx create-react-app myapp
Node version 13 has an issue for ReactJs, please check your version.
You can update or degrade(LTS version) your node version to work ReactJs properly
you need to upgrade node version to 14.5 or latest version with:
sudo n latest // on mac or linux for latest version
for windows just reinstall you node with latest version
Upgrade to version 14.5 will solve this issue.
For anyone using nvm,
you can use nvm install <version-number> to install any version.
In my case, I had v13.2.0 previously installed.
So, I checked all available versions with nvm ls-remote
And then picked the latest version to install like so:
nvm install v14.8.0
and as per #iamnabink comment - nvm use v14.8.0
This is because latest version of colorette doesn't supported on node Version < 14.
Try below steps if you don't want to install node V14.5
To uninstall colorette:
npm uninstall colorette
To install colorette version 1.2.0:
npm install colorette#1.2.0
This fixed my issue.
Else you can simply upgrade the node version.
Fixed this problem by upgrading node.js to v14.5.0. After upgrading, I also had to delete my node_modules folder and rerun npm install.

React installation on mac

i need some help because i recently start to work on my macbook (until my ubuntu VM) and i have some trouble with the installation.
And now when i load my old project i got this :
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: /Users/gauloix/Documents/GitHub/BuyTheWay-FRONT/src/index.js: Unexpected token (10:0)
obviously i missed something during the pkg installation or something witch brew :/
If the error was to obvious dont blame me i've just finised my formation and i'm newbie ^^'
image description here
Thanks beforehand !
This might be error of babel library .
Try this "npm install -D babel-loader#latest #babel/core#latest #babel/preset-env#latest" installation . It might helpfull.
First of all, I would suggest you to use nvm for managing different Node.JS versions. Installing it is easy:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
Once installed, you can install and use any Node.JS version with simple commands like:
# Install the latest Node.JS version
nvm install node
# Install a specific version
nvm install 6.14.4
# Use Node.JS version marked as "default"
nvm use node
# Or use some other version
nvm use node6
Once you have nvm ready, use npx to create a completely new React app and try to start it:
npx create-react-app myAppName
cd myAppName
npm start
If you don't get any errors during this process, I would suggest to simply overwrite newly created React app with your old code, excluding package.json. Before running the app with overwritten code, uninstall all packages you installed globally for the time being:
# List all globally installed packages
npm list -g -depth 0
# Use `npm uninstall` and uninstall them all:
npm uninstall whatever-globally
Finally, you will probably need to install some other dependencies (check your old package.json) manually:
npm install dep-1 dep-2 dep-3 ...
And then try to run the project with:
npm start

Doesn't work "npx create-react-app my-new-app --typescript"

Please help me. When I try to generate a project (creative-react-app), I get an error, you can look in the screenshot. The screen also shows the versions of node, npm and npx. I am using Linux Ubuntu 18.04.4 LTS.
Try to uninstall your nightly Node version and install the stable version of Node. In the error, it says that babel isn't compatible with your version of Node.
It also could be that you have an old version of React installed locally. So if the first fix doesn't work try
npm uninstall react

Angular installation

I want to install Angular version 4.* on my windows 7.
I am currently using Angular version 1.6.*
I tried following command
npm install #angular/{common,compiler,compiler-cli,core,forms,http,platform-browser,platform-browser-dynamic,platform-server,router,animations}#next --save
But its not working
Can any one please guide me to install and to create angular 4 project..
Make sure you have node version above 6.9 and npm above 3
Check the version by using node --version and npm --version
Install angular cli using npm install -g #angular/cli
-g installs the angular globally on your system and you just have to run this command only once
Create the angular project using ‘ng new angularprojectname’
Go to that project folder and check the angular version by ‘ng -v’
Upgrade this version to angular 4 by running this command-
For Windows-
npm install #angular/common#next #angular/compiler#next #angular/compiler-cli#next #angular/core#next #angular/forms#next #angular/http#next #angular/platform-browser#next #angular/platform-browser-dynamic#next #angular/platform-server#next #angular/router#next #angular/animations#next --save
For Linux/Mac-
npm install #angular/{common,compiler,compiler-cli,core,forms,http,platform-browser,platform-browser-dynamic,platform-server,router,animations}#next --save
Make sure to upgrade the typescript version by running command-
npm install typescript#2.2.1 --save
Ignore whatever warning it shows up and now check the angular version by ‘ng -v’
The version has changed from 2.2.4 to 4.1.0
You can also check all the info about your angular cli in package.json file.
You just need to install npm -g install angular-cli
And write sudo if you are using mac or ubantu
Then go to directory where you want project and then ng new PROJECTNAME
It will create project
Hope it helps you
I am adding this to update the answer.
If you want to install the latest angular version others answers are for you.
If you want to install a specific version of angular (Get your version number here)
You should use the below command.
npm install -g #angular/cli#VERSION_NUMBER
for example, if you want to install angular 1.4.9 command should be like below
npm install -g #angular/cli#1.4.9
I have also found the same issue while installing.
Please Do check npm and nodejs version and upgrade them.
I'd like to recommend node v6.x.x and npm 4.x.x or higher
There are many ways to structure AngularJS applications. When you begin to upgrade these applications to Angular, some will turn out to be much more easy to work with than others. There are a few key techniques and patterns that you can apply to future proof apps even before you begin the migration.
Follow the AngularJS Style Guide
Using a Module Loader
Migrating to TypeScript
Using Component Directives
Upgrade with ngUpgrade
Or up can follow the official document of Angular
For installing Angular 4 follow below simple steps:
Install node.js and npm(they are required dependencies. npm is automatically installed on installing node.js). You can install it
from here
With the help of npm install angular CLI. Type the following command in your command prompt: npm install -g #angular/cli
If you are still facing some problems you have to install git. You can install it from here
Now to create an angular 4 project using Angular CLI type the following command:
ng new [Project_Name]
This will create an Angualr 4 project.
5.To start the server and get your project up and running type following in command line:
ng serve
Remember you should be inside the project folder before starting the server. Hope this helps.
You have some libraries, Like
angular-material, angular-cdk`
etc...
Add all those and Try.
It will work for sure.
And you will be able to run the project
Install angular cli globally.
npm install -g #angular/cli
Get git pull from repository:-
[https://github.com/blazehub/ng-cli-starter.git]
to get ready made production ready project structure.
If you are looking for latest angular version use this command to install
npm -g install #angular/cli

Resources