Cannot install ionic using npm - npm

Please check the below image and give a solution for this, I am stuck, please help.

Finally was able to fix the issue and install ionic, so I was hoping I should share it, if anyone having the same issue please check if my steps also works for you.
Turn off Windows Firewall
Turn off any/every Antivirus or windows defender you are running.
Clear npm cache, run - $ npm cache clean
Remove Nodejs
Restart PC
Install latest version of Nodejs
Clear npm cache again, run - $ npm cache clean
[important] First only install cordova, run - $ npm install -g cordova
Then install Ionic, run - $ npm install -g ionic
Hopefully it will work, this how I was able to fix my issue.

You have to install Node JS 0.12.6 Version,
and after that, use:
$npm install -g cordova ionic
in DOS (cmd). It will install ionic and Cordova.

Related

Not able to uninstall Appium 2.0.0-beta.46 on mac Monterey

I used npm to install appium 2.0.0-beta.46.
After that I installed appium 1.22, but the appium -v still shows 2.0.0-beta.46.
So I tried various options
npm uninstall -g appium#2.0.0-beta.46
sudo npm uninstall -g appium#2.0.0-beta.46
sudo npm uninstall -g appium#beta
sudo npm uninstall -g appium#next
Plus
npm cache clean --force
But still, I am getting
$ appium -v
2.0.0-beta.46
When I did
$which appium, I get
/usr/local/bin/appium
I rebooted the system twice, but no use.
What is the best way to do the uninstall the 2.0.0-beta.46 and go back to 1.22 ?
Appreciate the help.
Perhaps also uninstall appium 1.22, hoping all is cleaned up after that.
npm uninstall -g appium
Because I am unable to uninstall all the fragments of Appium 2.0, 1.22, node etc., I took the risk of installing the trialware PowerMyMac tool, and could able to clean all the software. I know it is not a solid solution and I won't suggest to others, but I was desperate and it did worked.

RN Expo issue - Something when wrong installing JavaScript dependencies. Check your npm logs. Continuing to initialize the app

I am using react native and Expo. I am unable to build new app because after I use expo init appName it shows the following error.
Heres the full message:
📦 Using npm to install packages. You can pass --yarn to use Yarn instead.
√ Downloaded and extracted project files.
× Something when wrong installing JavaScript dependencies. Check your npm logs. Continuing to initialize the app.
✅ Your project is ready!
To run your project, navigate to the directory and run one of the following npm commands.
- cd Scanner
- npm start # you can open iOS, Android, or web from here, or run them directly with the commands below.
- npm run android
- npm run ios # requires an iOS device or macOS for access to an iOS simulator
- npm run web
I tried multiple times to create a blank project, also tried npm install to install failed/not downloaded libraries and continue after failure but it showed another error:
npm ERR! code Z_BUF_ERROR
npm ERR! errno -5
npm ERR! zlib: unexpected end of file
also tried npm cache verify that showed cache is ok Content verified: 3562 (252580364 bytes).
So, How can I solve this issue?
Problems related to npm installation are very common If you do any mistake in early installation, but is avoided. Learn more about npm tree.
Steps worked for me are :
npm cache clean --force
npm cache verify
npm -g uninstall expo-cli --save
npm install expo-cli --global
expo init app-name
cd app-name
npm start
Always run as administrator if working on Windows and in root directory.
The solutions above didn't work for me but if you use 'npm install' in the directory of the app you get a clue that you shuold try 'npm install --force'
err message
You should have all these files folders and files at the start of the project otherwise not all the dependencies have been installed which is why we were getting the problem.folder structure
After you have added --force to npm install you have all the dependencies installed. Now you can run the app with npm start.
Unfortunately, all the solutions described above didn't work on my machine...
Here is my latest solution for this problem...
This worked 100% on my machine...
Use npm i -g expo-cli
This will automatically add the required packages and also remove the unnecessary ones.
Yes, surely, you don't need to uninstall and re-install it again.
Just follow my steps.
And, you can create your expo project using expo init.
I hope my solution will help you out from this annoying problem....
I just did npm install and it worked for me, but I had do that every time I create a new expo project.
I also encountered this problem, and finally found that it was the problem of react native cli,I installed the latest version of react native cli,Expo is back to normal
This Error is regarding to the git account. expos need a git account to setup react native project
If you are using windows you need to install git in your local PC
after that open your Terminal and type this command
git config --global user.name "your_username"
git config --global user.email "your_email_address#example.com"
after that clone any github project to your local computer. it will ask to login to Github
after all these steps try expo init <projectname>
The simple way to settle that error is by using "expo-cli init app-name" instead of "expo init app-name".
I tried and worked perfectly for me. Hope it will help you guys.
i have faced a similar problem and running yarn set version 1.22.1 fix it
Run the Command Prompt as an administrator. And run the following command:
npx create-expo-app AwesomeProject

npm install -g not working while uninstalling react-native-cli?

I am trying to uninstall the "react-native-cli" which I use for react-native projects! but I am not able to do so!
My environment is mac.
Here is what i have done so far!
Whether I type npm uninstall -g react-native-cli or sudo npm uninstall -g react-native-cli.
The terminal shows: up to date in 0.041s
When I type react-native init projectName, it still creates the project.
I think the command react-native init should not to work.
Anyone knows how to uninstall react-native-cli ?
Thanks in advance.
SOLUTION ONE !
not fully sure this will work! but try updating your npm first by doing
npm install npm
and after that try uninstalling the cli if that does not work then
SOLUTION TWO !
Here is another go around to solve the issue its a bit manual way
1: First run this
npm list -g
this will show the list of installed packages in your user folder
then check . using command+f if there is react-native-cil there
then do this
open /usr/local/lib/node_modules
This will open the root installed packages and you can manually find and delete the react-native-cli like this
If you are using yarn. You can do yarn global list then check that if any package contains react-native. Then run yarn global remove <package> to remove that package.
ex:
yarn global remove #react-native-community/cli
You can uninstall react native CLI using:
npm uninstall -g react-native-cli

Can't run "npm install expo-cli --global"

I am a newbie in all this stuff. Hope for your understanding.
Let me clarify the issue:
I am trying to start react native app through expo cli. So tried to start npm install expo-cli --global to install npm globally. I got these errors:
Screen_1
Screen_2
It also says that I lack permissions to access it. How can I allow permissions?
Even when I try to start it locally I got the same issue. Your help is appreciated.
although this solution is not the best and the safest solution exists, this worked for me and that make sense because all the problem we had with the errors is the permission problems. so you can use this command and ignore those permission problems :
sudo npm install expo-cli -g --unsafe-perm
I was having the same problem with npm install -g expo-cli, having "MODULE_NOT_FOUND",
I installed yarm with brew, just in case you do not already have it:
brew install yarn
and then use:
yarn global add expo-cli
to create a project you can:
expo init nameOfTheNewProject
and choose a template in the console.
Finally run the project with
yarn start
Let me know if it works for you!
You did not mention which os. This answer working for any operating system (ubuntu in my case)
I'm also getting permission errors when running
sudo npm install --global expo-cli
Which I don't really how this can happen - as this also happens for the superuser!
For me it works when I install the client locally into the project
cd <new-project-dir>
npm init # init npm project
npm install expo-cli
Now you can use the client in this project like this:
npx expo-cli # e.g. npx expo-cli init <project-name>
npm cache clean --force
This will solve the issue
Try using npm install -g expo-cli#3.5.0 this worked for me, it may work for you.
You can try this command:
npm install -g expo-cli
or,
yarn global add expo-cli
You have to run the command as administrator from a command prompt on windows and not bash. Had me stumpt for bloody ages!
You need administrator privilege. So when you open command line interface, just right click and run as administrator
This will solve the problem
I guess, this issue comes from permission or node version , if you get this error when the node module is being refreshed ---> This is definitely a permission issue. Disable your Antiviruses or change permission manually check this as well.
First run npm cache verify, then run sudo npm install --global expo-cli.
Did work for me indeed after trying so much.
Follow the steps
First, run npm cache verify.
Open Windows PowerShell as administrator and run npm install expo-cli
--global --no-optional command.
npm cache clean --force then npm install --unsafe-perm -g expo-cli
It is likely you do not have the permissions to access this file as the current user.
The best way to solve this problem is to reinstall npm with a node version manager.And you don't need to remove your current version.
About node version manager
use nvm or n with OSX or Linux
use nodist or nvm-windows with windows
Upgrade Node version to +10
Then do
sudo npm install expo-cli -g
This worked for me. I hope this would solve your problem!
sudo npm install expo-cli -g --unsafe-perm=true --allow-root
If any of the solutions above result in success, please follow the steps below:
Uninstall Node.js
Restart your pc/mac
Download latest version of the Node.js (https://nodejs.org/en/)
Open cmd as admin mode or use "sudo" before the command line on Mac.
npm install expo-cli --global
I hope it can help
In my case, I deleted two files then everything worked. The two files are in this path: C:\Users\{Username}\AppData\Roaming\npm under the names 'expo.ps1' and 'expo-cli.ps1'
Then run:
npm i -g expo-cli
re-install node.js, it works for me
First update Node.js to the latest stable version and then again try to install expo ad clean before expo folders that are being created in below location
C:\Users\{{computer_username}}\AppData\Roaming\npm
If it's throwing error in visual studio code, try from cmd, was facing same error but solved through this way
npm install -g expo-cli
try going into windows resource monitor and terminating adb.exe (android resource bridge). This worked for me after searching for solutions for days. I tried this after verifying cache, clearing cache, you name it.
As a Debian 10 buster user I got the same permission error while using this command: sudo npm install expo-cli --global.
The problem was solved by installing expo-cli with yarn package manager and the command below: sudo yarn global add expo-cli.
For Windows User :-
Open your Powershell and type:
npm install expo-cli --global
This worked for me after trying and reasearching for hours.
Note:Don't Use cmd or any other terminal and also don't type npm install expo-cli -g as it is written in the react native docs. It would always show up an npm error.
For windows
Follow these steps carefully
open the command prompt and run it as administrator.
recommended npm uninstall --global expo-cli.
run the command npm cache clean --force.
run the command npm cache verify .
now run the command npm install --global expo-cli
dont run command like npm i -g expo-cli or npm install -g expo-cli.
7.Make sure you run the command mentioned in the 4th step ONLY.
thankyou.
I had this problem in Windows 10, to be able to install the latest version (I had no choice since it broke the current one). I had to install the latest version of Python (3.8.0) and then run npm install --global --production windows-build-tools as an administrator, then I was able to run again: npm install expo-cli --global to install the version 3.8.0 of the expo-cli
Here is the solution and 100% working. I am working with Windows and not sure abut Linux.
Open cmd and
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
then press yes
Now run the command to start your project
npm install -g expo-cli
I had previously removed Expo from my Windows machine and encountered this error whilst trying to reinstall. Reading the error message solved the problem.
npm i expo-cli -g --legacy-peer-deps
Using this command in 'PowerShell' installed expo successfully.
If anyone else has this problem here is my fix, go to Finder, in the input field (search box) type in /usr/local/lib then press CMD + SHIFT + G press the OK button or whatever pops up, then CMD + SHIFT + . and delete the NVM file i deleted the expo folder too. Then go to this link https://changelog.com/posts/install-node-js-with-homebrew-on-os-x
follow the instructions and install brew, node, etc. Last step go to your terminal and type sudo npm install expo-cli --global
First: I upgraded my mac version 10.13 to 10.15
Then I downloaded homebrew, Watchman, Git and Node.js
Finally I ran this command sudo npm install --global expo-cli --legacy-peer-deps
If you have any further questions check the docs out: https://docs.expo.dev/get-started/installation/
Sometime, I use npm not work.
I try a lots times run with npm but fail for expo cli.
Please try yarn global add expo-cli
It wills save your time ^^.
I was trying to install expo-cli with my company npm registry configured.
I've created 2 differents profiles using npmrc and using the profile with https://registry.npmjs.org/ solved the issue.

Cannot uninstall ionic using npm on Mac

I am trying to switch to ionic2. Installing on top of my previous installation of ionic 1 appears to succeed (based on the output) but ionic1 remains as shown by ionic info. Here were the steps. Any help would be appreciated.
Successfully Installed ionic2#beta using sudo npm install -g ionic#beta
ionic -v shows version 1.7.14
Uninstalled using npm uninstall -g ionic
Successfully (based on printout) uninstalled ionic 2
ionic -v shows version 1.7.14 (WTF)
Tried 'npm uninstall -g ionic' again
Received command prompt immediately, no other outputs (no affect)
ionic -v shows version 1.7.14
With some investigation I found out what was going wrong. At some point earlier I had installed ionic version 1 which got loaded by npm in /usr/local/lib as part of the sub-directory node_modules. Later on when I installed version 2 globally with sudo it installed it in my home directory ~/.npm-global/lib/node_modules/ionic/bin. The installed program was a node script called ionic. The bash alias was still pointing to the version 1 code. I don't know why npm changed the directory. To fix the problem, I did the following:
Deleted the folder /usr/local/bin/node_modules/ionic
Removed the symbolic link to the alias named ionic
Re-installed the ionic#beta globally using sudo. This created the node script ionic in ~/.npm-global/lib/node_modules/ionic/bin.
Tested it using the full path to the node script ionic
In the process of creating a symbolic link named ionic so I can access the command from anywhere in my home directory.
Have to load cordova 4.3 and
I should have found this earlier but I am getting rusty in my command line skills. It turns out that ionic-cli is works for both v1 and v2.
You are using wrong command ionic2#beta to install ionic 2. Use
$ npm install -g ionic#beta
use this
sudo npm uninstall -g ionic
This works for me on ubuntu 16,
to remove cordova, ionic:
sudo npm uninstall -g cordova
sudo npm uninstall -g ionic
and for npm:
sudo npm uninstall npm -g
hope it will work
For mac user delete this folders.
/usr/local/lib/node_modules/ionic
/usr/local/share/npm/lib/node_modules/ionic
As you could install it with
npm install -g ionic
you should uninstall it with
npm uninstall -g ionic