installing ionic npm ERR! tar.unpack error - android

while installing ionic npm install -g ionic getting error.
Have tried : -
npm cache clean 2. run the cli by administrator 3. restarted the system but error remain same.
Badly stocked.

I was having same problem on Windows 8 (64 bit)
Solution:
Don't forget to install other dependencies before installing ionic http://ionicframework.com/docs/guide/installation.html
1) Uninstall Node from Control Panel
2) Restart PC
3) Download (MSI Installer) older version of Node from http://nodejs.org/dist/v0.10.38/ or 64bit http://nodejs.org/dist/v0.10.38/x64/
4) Install Node version 0.10.38
5) npm install -g cordova
6) npm install -g ionic
Done!

it is not nessesary to uninstall node...
just remove the old npm ionic folder
...AppData\Roaming\npm\node_modules\ionic
and try again
npm install -g ionic

For me the answers provided did not work. I got around this problem by installing cordova and ionic at the same time.
npm install -g cordova ionic
If proxy is preventing this, other things to try are setting the proxy, making http request and disabling strict-ssl. An example of setting proxy is
npm config set proxy=http://username:password#domain:port/
To make http request only change the config
npm config set registry=http://registry.npmjs.org/
To disable strict-ssl
npm config set strict-ssl=false
Also, if you wanted to view the default list of configs type
npm config ls -l
This will also show what configurations have been overridden.

Uninstall Node.js and install freshly after done installation run the following command
npm install -g ionic cordova
That's it.

Related

React Navigation Error on npm install

I'm trying to create a new react native app with react navigation.
I did the following:
1.) create-react-native-app myAppName
2.) cd myAppName/
3.) npm install --save react-navigation
4.) Expecting successful installation of react-navigation but instead i get:
C:\Users\Maima\Documents\GitHub\React\test>npm install --save react-navigation
npm WARN rm not removing C:\Users\Maima\Documents\GitHub\React\test\node_modules
\.bin\jest.cmd as it wasn't installed by C:\Users\Maima\Documents\GitHub\React\t
est\node_modules\jest
npm WARN rm not removing C:\Users\Maima\Documents\GitHub\React\test\node_modules
\.bin\jest as it wasn't installed by C:\Users\Maima\Documents\GitHub\React\test\
node_modules\jest
npm WARN rm not removing C:\Users\Maima\Documents\GitHub\React\test\node_modules
\.bin\rimraf.cmd as it wasn't installed by C:\Users\Maima\Documents\GitHub\React
\test\node_modules\rimraf
npm WARN rm not removing C:\Users\Maima\Documents\GitHub\React\test\node_modules
\.bin\rimraf as it wasn't installed by C:\Users\Maima\Documents\GitHub\React\tes
t\node_modules\rimraf
npm WARN rm not removing C:\Users\Maima\Documents\GitHub\React\test\node_modules
\.bin\uuid.cmd as it wasn't installed by C:\Users\Maima\Documents\GitHub\React\t
est\node_modules\uuid
npm WARN rm not removing C:\Users\Maima\Documents\GitHub\React\test\node_modules
\.bin\uuid as it wasn't installed by C:\Users\Maima\Documents\GitHub\React\test\
node_modules\uuid
npm WARN rm not removing C:\Users\Maima\Documents\GitHub\React\test\node_modules
\.bin\semver.cmd as it wasn't installed by C:\Users\Maima\Documents\GitHub\React
\test\node_modules\semver
npm WARN rm not removing C:\Users\Maima\Documents\GitHub\React\test\node_modules
\.bin\semver as it wasn't installed by C:\Users\Maima\Documents\GitHub\React\tes
t\node_modules\semver
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN react-navigation#1.0.0-beta.23 requires a peer of react#* but none is i
nstalled. You must install peer dependencies yourself.
npm WARN react-navigation#1.0.0-beta.23 requires a peer of react-native#* but no
ne is installed. You must install peer dependencies yourself.
npm WARN react-native-tab-view#0.0.74 requires a peer of react#* but none is ins
talled. You must install peer dependencies yourself.
npm WARN react-native-tab-view#0.0.74 requires a peer of react-native#* but none
is installed. You must install peer dependencies yourself.
npm WARN react-native-drawer-layout-polyfill#1.3.2 requires a peer of react-nati
ve#* but none is installed. You must install peer dependencies yourself.
npm WARN react-native-drawer-layout#1.3.2 requires a peer of react#* but none is
installed. You must install peer dependencies yourself.
npm WARN react-native-drawer-layout#1.3.2 requires a peer of react-native#* but
none is installed. You must install peer dependencies yourself.
+ react-navigation#1.0.0-beta.23
added 8 packages, removed 973 packages and updated 20 packages in 259.667s
Please Help, Cant npm start my React Native App.
It can be solved by running a npm install command again and reinstall the npm install --save react-navigation command.
I cant comment because I dont have the points, so heres a tentative answer with the info at the moment:
I had similar issue when running Expo on Windows. to solve I had to close XDE and reinstall.
if that's not enough, delete the "node_modules" folder and run "npm install".
They aren't errors, just warnings telling you that some peer dependencies that navigation relies on aren't installed. Based on your commands, you need to run npm install or yarn install to install all the packages. Creating the app with create-react-native app give you a list of packages but you have to actually install them with npm install. If something funky happens, do what #vbandrade suggested and hose your node_modules and package.lock, then do a fresh npm install
The same error appeared when I tried to run npm install --save react-navigation. Turns out I needed to run npm install prior to npm install --save react-navigation.
Followed the steps but got error with npm install. I am also using Expo (as mentioned by #vbandrade) and there are also problems with that. First of all, i think react-navigation is changing a lot. After trying a lot (before applying the solution in the accepted answer), i installed react-navigation and its dependencies multiple times and it worked at one time when i first ran;
npm install react-navigation
then
npm install #react-navigation/native
(which doesn't make too sense for me as that gets auto installed with react-navigation). Then i ran;
npm install react-native-reanimated react-native-gesture-handler react-native-screens react-native-safe-area-context #react-native-community/masked-view
for installing dependencies and it worked. Honestly i didn't understood anything that how it worked. So for the sake of learning i installed the project and reinstalled it with expo and after that nothing worked. So i applied #vbandrade's answer but it was giving some more errors after i ran npm install.
To get rid of these errors, i found another solution (from stackoverflow). Here is that solution.First of all delete node_modules folder and package-lock.json file and close your editor or any other file where your project is open (because node doesn't install some packages if the project is open).
Then,
First run this command;
npm cache clean --force
Then,
npm install
And then;
npm install react-navigation
And at last install the dependencies;
npm install react-native-reanimated react-native-gesture-handler react-native-screens react-native-safe-area-context #react-native-community/masked-view
Run your project;
If using expo;
expo start
Errors must be gone now.
If you are running your expo server, stop the server and continue npm install --save react-navigation . It worked for me.

Ionic 3 Android build error

I am using Ionic 3. Right now I'm trying to do ionic cordova build android , but I get TypeError: env.runcmd is not a function (please see the photo attached).
I tried to:
-> ionic cordova platform rm android then ionic cordova platform add android then again build android again
-> delete node_modules folder and do npm install then build android again
But none of them helped it...
My ionic info output:
Just use command 'cordova run android' instead of 'ionic cordova run android'.
Okay, guys, the problem was exactly with cordova version. I haven't noticed when it did update to the version 7.0.1. However, I had to downgrade it to version 6.5.0 and then android build succeeded.
The only thing that confused me was the downgrade process. Every time I did sudo npm uninstall cordova -g, the cordova command was still available at bash. If I would do sudo npm install cordova#6.5.0 -g, the version still remained 7.0.1. Even some other commands such as ... --save --save-exact ... did NOT work.
So below are the steps which I've gone through to solve this issue (I am using Ubuntu linux, so this will work for linux users only).
First I uninstalled cordova through npm
sudo npm uninstall cordova -g
Then removed the program from local bin
sudo rm /usr/local/bin/cordova
Installed the specific version of cordova
sudo npm install cordova#6.5.0 -g (or whatever version you want)
And lastly, I have to admit that after cordova installation, it was now located at /usr/bin/cordova, no more at /usr/local/bin/cordova, so I had to create a hard link to it.
sudo ln -s /usr/local/bin/cordova /usr/bin/cordova
VoilĂ !

Installing Ionic for android development gets stuck

When I try to run the command npm install -g cordova ionic, it gets stuck for hours.
I also faced the same problem .So, somewhere I found the below command which worked for me. npm install -g ionic cordova
Follow the below step for proceeding further
Clean the npm cache
Update npm and node version
reinstalling npm and node
I found that changing my Environment Variable TEMP to = C:\tmp worked.
use this tutorial https://docs.npmjs.com/cli/cache

Cordova not recognized as external command inside project folder?

I have cordova installed in my npm folder. After cd Project_name in command line and tying cordova add platform i am getting an error
"Cordova is not recognized as internal or external command"
. I don't know what is wrong is here. I followed each step given on cordova documnentation. Below is a screenshot of the error
First check everything you have installed:
node - v
cordova -v
if these are not installed then, install it first.
Download and install NodeJS from here: https://nodejs.org/en/
Then check again node -v
If you have installed node successfully then install cordova.
npm install -g cordova
and then check cordova -v
I suggest that you will take a tour of getting started with cordova: http://cordova.apache.org/#getstarted
Try reinstalling the cordova using:
npm install -g cordova
After this you will able to add the platform.
I think you haven't set Environment Variable for the node JS.
Please follow steps which are provided in this link.
delete "platform" folder
Try add re-platform :
npm install -g cordova
or
Try reinstalling the cordova using:
npm install -g cordova
The Below steps helped me out:
Install Cordova using: npm install -g cordova
Check if Cordova is installed: To check go to "C:\Users\your username\AppData\Roaming\npm\node_modules" and search for Cordova folder. If it does not exists then in CMD run 'npm install -g cordova' to install cordova or reinstall npm and run 'npm install -g cordova'.
Environment variable PATH Exists: To check go to Environment variable (My Computer OR My PC > Right Click > Properties > Advance System Settings > Environemnts Variable button)
add
%appdata%\npm\ or c:\users\YourUserName\AppData\Roaming\npm
(replace YourUserName with the name of your user profile) to System Variable's PATH
Below are the screenshots step by step actions on Environment PATH.

Can't install react-native-cli after following tutorial

Before reading and following the tutorial in NPM I installed the react-native-cli globally and it worked just fine
But in the tutorial it asks you to install sinopia
https://www.npmjs.com/package/react-native-cli
Then it gives you these instructions
react-native$ npm set registry http://localhost:4873/
react-native$ npm adduser --registry http://localhost:4873/
# Check that it worked:
react-native$ npm config list
react-native$ npm unpublish --force
react-native$ npm publish
react-native$ cd react-native-cli/
react-native-cli$ npm unpublish --force
react-native-cli$ npm publish
But the unpublish part gave me an error. the same for the 'publish' aprt.
(By the way, publish what?!)
Then it says to uninstall react-native-cli
npm uninstall -g react-native-cli
After that I couldn't reinstall react-native-cli.
It says the package is not available.
npm ERR! 404 no such package available : react-native-cli
npm ERR! 404
npm ERR! 404 'react-native-cli' is not in the npm registry.
What is this?! How can I fix it?
#edit
By the way, I don't understand why, in the Get Started tutorial it doesn't tell us how to install the react-native-cli nor gives us a link. It just states:
The React Native CLI #
Node.js comes with npm, which lets you install the React Native command line interface.
#edit2
I just managed to install react-native-cli by removing the 'registry' entry from npm config, installing it and adding Sinopia again.
I thought Sinopia worked as a proxy. If it is not found in local repository, it looks for it in NPMJS...
I even tried to install other things and I could (wdio, nodemon), I just got an error with react-native-cli.
It seems that something is wrong.
Seems like you on Windows
I don't think you need sinopia.
Tutorials was little improved on master branch of the docs: http://facebook.github.io/react-native/releases/next/docs/getting-started.html
In short:
Install node.js
Install react-native-cli: npm install react-native-cli
Install & setup Android SDK
Create & run project
react-native init AwesomeProject
cd AwesomeProject
react-native start
react-native run-android

Categories

Resources