I upgraded npm and nodejs to 6.14.4 and 12.16.3 resp. Getting below error while creating react app using create-react-app.
According to readme:
If you've previously installed create-react-app globally via npm
install -g create-react-app, we recommend you uninstall the package
using npm uninstall -g create-react-app to ensure that npx always uses
the latest version.
So resolved the problem using command:
npx create-react-app contactmanager
I am trying to upgrade expo-cli from 2.11 to 2.18 but npm i -g expo-cli#latest still points to the old version.
when I typed expo-cli -V it resulted:
2.11 ...so naturally npm i -g expo-cli#latest will grab the latest version and install it but still expo-cli -v is still pointing to the old version.
I remember installing packages in bash level is a no go operation.
these are some images to put it all into context:
Update: Removed Nodes modules as suggested in the first answer, and that lead to npm removal both expo and expo-cli are not found with the command where
For mac users (linux should be very similar):
Find your expo-cli version:
which expo-cli
For me it yielded:
/Users/username/.config/yarn/global/node_modules/.bin/expo-cli
Remove this outdated version:
rm -rf /Users/username/.config/yarn/global/node_modules/.bin/expo-cli
Check that you are using the latest version:
expo-cli --version
Updating expo-cli globally can be a right pain. To those experiencing this frustration, use yarn
yarn global add expo-cli
it will give you far fewer headaches
On MacOS (Linux should be very similar):
Find the location of the expo-cli version:
which expo-cli
You would probably get:
/usr/local/bin/expo-cli
Remove this outdated version by using:
rm -rf /usr/local/bin/expo-cli
Then install the latest version:
npm install -g expo-cli
After that, check that you are using the latest version:
expo-cli --version
If you're like me, and none of this stuff worked, maybe my solution will help.
My problem is that I switched from NPM, to Yarn at some point, and I had global packages in both systems, which was giving me a bunch of trouble.
Step 1: Make sure you don't have expo-cli in global npm
npm list-g
Step 2: If it is in global npm, uninstall it
npm uninstall --global expo-cli
Step 3: Install it fresh with yarn
yarn global add expo-cli
Step 4: Stop using npm for global packages (or at least, only use one system)
edit: spelling
If you are using a Mac, these 2 commands will do the tricks
1)which expo to locate expo in your Mac which will give you this "/usr/local/bin/expo"
2) "cd /usr/local/bin/"
3)-rm expo
4)-rm expo-cli
the hole system was behaving oddly!, npm should've been installed with node but it was nowhere to be found.
I had to remove node and reinstall it again, then I had to install expo-cli again and all errors went away.
When npm does not work in an easy way, --force it!
npm install -g expo-cli --force
Update to the latest version of Expo CLI:
npm i -g expo-cli. expo-cli#4.7.2 or greater is required.
Update to the latest version of EAS CLI if you use it:
npm i -g eas-cli.
Run expo upgrade in your project directory.
Reference: https://docs.expo.dev/workflow/upgrading-expo-sdk-walkthrough/
there is more than a reason for not updating the expo-cli.
reason 1 - you maybe installed expo-cli using yarn and after a while you need to update and using npm npm install -g expo-cli it will update but maybe when you run expo its point to that yarn version so to resolve this you need to run yarn global remove expo-cli.
reason 2 - it might you have two versions of expo-cli one its global version and one inside your project folder/path, so even you upgrade expo-cli globally, your project still point to the first class version which is in your project folder. to resolve this you need to uninstall expo-cli which exists in your project folder to point to the global version and you can do this using this command npm uninstall expo-cli notice without -g.
reson 3 - sometimes you need to clean npm cache. if nothing works for you above try to uninstall expo-cli using npm uninstall -g expo-cli and then run this command npm cache clean --force then install expo-cli again npm install -g expo-cli.
expo-cli --version
npm uninstall expo-cli
npm install -g expo-cli
expo-cli --version
if cannot, you can update manually
check path
npm bin -g
change "node_modules" folder or remove
C:\Users{username}.npm-global\node_modules
npm install -g expo-cli
copy\past expo-cli folder
from C:\Users{username}.npm-global\node_modules\expo-cli
to C:\Users{username}\AppData\Roaming\npm\node_modules\expo-cli
expo-cli --version
I am getting issue in my Ubuntu regarding reinstalling of angular.
my current version:
Angular 1.7.3
Node: 8.11.1
OS: Linux
Angular: 4.4.4
I want to reinstall from angular 1.7.3 to angular 1.6.8
Please help..
Correct command now is this:
npm uninstall -g angular-cli
npm cache clean --force
npm install #angular/cli#1.6.8
The key here is first # before angular and angular/cli not angular-cli.
You can uninstall the current version of angular cli- 1.7.3 and install 1.6.8
npm uninstall -g angular-cli
npm cache clean
npm install -g angular-cli#1.6.8
I've tried running npm install npm#3 -g but my npm is still at 2.x:
How to install the latest beta?
It was a PATH issue - c:\Program Files\nodejs had higher priority than %APPDATA%\npm which was causing npm to be stuck at the older version.
I am on Ubuntu 12.04 and installed npm via the automatic script and it installed 1.1.17. I am now getting the following error message when trying to install anything via npm: "npm ERR! TypeError: Arguments to path.resolve must be strings" I found a post stating a solution to my problem is to upgrade to 1.2.15 however I cannot figure out how to do that as updating via npm is throwing an error. How can I update npm without using npm?
I uninstall node and reinstall to fix this problem.