Ionic app creation gets stuck at “ionic start app_name tabs” - ionic-framework

I am new to ionic framework, facing below issue while creating first app.
**i am working behind corporate proxy
-> command executed “ionic start hello_ionic tabs”
Error Message :
? The directory hello_ionic contains file(s) that could conflict. Would you like to overwrite the directory with this new project? Yes
√ Creating directory .\hello_ionic - done!
√ Downloading and extracting tabs starter - done!
? Would you like to integrate your new app with Cordova to target native iOS and Android? Yes
√ Personalizing ionic.config.json and package.json - done!
ionic integrations enable cordova --quiet
√ Downloading integration cordova - done!
√ Copying integrations files to project - done!
[OK] Added cordova integration!
Installing dependencies may take several minutes.
IONIC DEVAPP *
Speed up development with the Ionic DevApp, our fast, on-device testing mobile app
Test on iOS and Android without Native SDKs
LiveReload for instant style and JS updates
️ –>Install DevApp:
npm i
Running command
ionic start stuck at “npm i”.
please help me in resolving this issue.
->output of “npm info”
{ name: ‘hello_ionic’,
description: ‘a’,
‘dist-tags’: { latest: ‘1.0.0’ },
versions: [ ‘1.0.0’ ],
maintainers: [ ‘gboog andersonthomas603#gmail.com’ ],
time:
{ modified: ‘2017-04-19T13:42:30.205Z’,
created: ‘2017-04-19T13:42:30.205Z’,
‘1.0.0’: ‘2017-04-19T13:42:30.205Z’ },
homepage: ‘https://github.com/WebGExecutive/app#readme’,
keywords: [ ‘sss’ ],
repository:
{ type: ‘git’,
url: ‘git+https://github.com/WebGExecutive/app.git’ },
author: ‘Griffin Blotner’,
bugs: { url: ‘https://github.com/WebGExecutive/app/issues’ },
license: ‘ISC’,
readmeFilename: ‘’,
version: ‘1.0.0’,
main: ‘index.js’,
scripts: { test: ‘s’ },
dist:
{ shasum: ‘73936188b9f38359107be3fce56da2643d195a89’,
tarball: ‘https://registry.npmjs.org/appapp/-/appapp-1.0.0.tgz’ },
directories: {} }

npm i does not works with Proxy.
You can refer to following links -
npm does not work behind corporate proxy and launched from apm
https://www.c-sharpcorner.com/article/how-to-use-npm-install-the-command-behind-corporate-proxy-server/

Related

Can't create an app with Ionic 3 running "ionic start"

I’m not able to create a new app with Ionic 3.20.1
Once I’ve chosen the template the console hangs and nothing else happens. Only an empty folder is created. BUT It’s going well with Ionic 4.
I also tried to run ionic start myApp blank and it loaded something into the folder BUT it stopped again after the next choosing step.
Could please anyone help me with this issue? I really need to use Ionic 3, but how to fix this?
Ionic 3.20.1
Cordova 8.1.2
Node.js 10.14.2
Thank you!
The console look
Upd: ionic info --verbose output:
[DEBUG] Reason for not using local CLI: BASE_DIRECTORY_NOT_FOUND
[DEBUG] CLI flags: { interactive: true, confirm: false }
[DEBUG] { cwd: 'D:\\...', local: false, binPath:
'C:\\...\\npm\\node_modules\\ionic\\bin\\ionic', libPath:
'C:\\...\\npm\\node_modules\\ionic\\dist\\index.js' }
[WARN] You are not in an Ionic project directory. Project context may be missing.
cli packages: (C:\...\npm\node_modules)
#ionic/cli-utils : 1.19.3
ionic (Ionic CLI) : 3.20.1
System:
Node : v10.14.2
npm : 6.5.0
OS : Windows 10
Misc:
backend : pro
The problem was node.js. I had to downgrade it v10->v8 and now it's working.

Can i run the ionic v1 project when i have ionic CLI 4.6.0?

Now I have the latest version of ionic 4.6.0. My ionic version: 4.6.0.
When I tried the old v1 command:
ionic build ios
I received:
The build command has been renamed. To find out more, run:
ionic cordova build --help
Then run with,
ionic covdova build ios
That failed with this:
[WARN] Could not determine project type (project config: ./ionic.config.json).
- For #ionic/angular projects, make sure #ionic/angular is listed as a
dependency in package.json.
- For Ionic 2/3 projects, make sure ionic-angular is listed as a
dependency in package.json.
- For Ionic 1 projects, make sure ionic is listed as a dependency in
bower.json.
Alternatively, set type attribute in ./ionic.config.json to one of:
angular, ionic-angular, ionic1, custom.
If the Ionic CLI does not know what type of project this is, ionic build,
ionic serve, and other commands may not work. You can use the custom
project type if that's okay.
Bad project type: undefined
Let me know If any thing I miss or need to change.
Yes you can, you just need to let the ionic cli know you are running an ionic1 project.
Open up the file "ionic.config.json" in a text / code editor.
In the json object, set type to "ionic1"
{
"name": "appname",
"integrations": {
"cordova": {},
"gulp": {}
},
"type": "ionic1", //Set it here
"watchPatterns": [
"scss/**/*",
"www/**/*",
"!www/lib/**/*",
"!www/**/*.map"
],
"pro_id": "12345"
}
That should allow you to run and build ionic 1 projects.
If you do not have an ionic.config.json file, create on in the root of you directory and then copy and paste the above (you can remove pro_id if you are not using ionic appflow) and change the appname to the name of your app.

ionic3 plugin and platform errors

I am using ionic CLI version 3.0.0-beta.5
When I am trying to install native plugins, I am getting these errors.
for example, installing social-sharing plugin
ionic plugin add cordova-plugin-x-socialsharing
and the error is
[ERROR] Unknown plugin: #ionic/cli-plugin-.
same error while adding platforms also..
C:\Users\varun\Desktop\apps\app>ionic platform add android
The platform command is no longer available. To find out more about the equivalent please run:
ionic cordova:platform --help
C:\Users\varun\Desktop\apps\app>ionic cordova:platform --help
[ERROR] Unable to find command: cordova:platform. It is possible that you are trying to get help on a project based command and you are not in a project directory.
Has anyone faced this problem? I am not getting enough information on official blog.
To fix "The platform command is no longer available" issue on Ionic3 beta 7 I tried the following:
ionic cordova:platform add android
However, it only worked for newly started projects so need to update ionic-scripts in your project.
Use this instead
cordova plugin add https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin.git
The repo name cordova-plugin-x-socialsharing is changed/missing
so, we can directly add plugin from plugin git repo.
shareWithOptions(option, successcallback, errorcallback);
Usage :
window.plugins.socialsharing.shareWithOptions( {
message: 'share this',
subject: 'the subject',
files: ['', ''],
url: 'https://www.gooogle.com',
chooserTitle: 'Pick an app'
},
function(success){
console.log(success);
},
function(err){
console.log(err);});

Ionic link does not work with Ionic v2

When I run ionic link command inside ionic project folder I got following error message
"You cannot run this command unless you are in an Ionic Project folder"
My system info.
Cordova CLI: 6.3.1
Gulp version: CLI version 1.2.1
Gulp local: Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.11
Ionic CLI Version: 2.0.0-beta.36
Ionic App Lib Version: 2.0.0-beta.19
OS: Distributor ID: Ubuntu Description: Ubuntu 14.04.4 LTS
Node Version: v6.4.0
You can use following command to setup app linking with Ionic IO.
ionic io init
this will update ionic.config.json with app_id and generate .io-config.json file with app_id and api_key.
ionic io init
is no longer available in cli 3. Create a new app from apps.ionic.io dashboard and then run
ionic link
which will list down apps from your ionic.io account and let you choose an app to which you want to link your local app. You have to run 'ionic login' if you haven't done so already.

crosswalk-lite in ionic cli v1.4.4 does not reduce apk size

Tried many times, the apk file size does not change.
ionic revert android;
ionic browser add crosswalk-lite
ionic build android
I also tried remove android platform and do from scratch, but never suceeded.
Your system information:
Cordova CLI: 5.0.0
Gulp version: CLI version 3.8.11
Gulp local: Local version 3.8.11
Ionic CLI Version: 1.4.4
Ionic App Lib Version: 0.0.20
OS: Distributor ID: Ubuntu Description: Ubuntu 12.04.5 LTS
Node Version: v0.12.3
Same here.
I guess crosswalk-lite is so new that ionic still doesn't quite cope with it. Or it did, but things have changed now.
When I run:
ionic browser remove crosswalk
ionic browser remove crosswalk-lite
ionic browser add crosswalk-lite
I get this ionic.projectfile:
{
"name": "chapter5",
"app_id": "27fa0870",
"browsers": [
{
"platform": "android",
"browser": "crosswalk-lite",
"version": "12.41.296.5"
}
]
}
ionic info output:
Cordova CLI: 4.2.0
Gulp version: CLI version 3.8.11
Gulp local:
Ionic Version: 1.0.0-rc.0
Ionic CLI Version: 1.4.5
Ionic App Lib Version: 0.0.22
OS: Distributor ID: Fedora Description: Fedora release 21
(Twenty One)
Node Version: v0.10.36
Also, take notice of your cordova-android version, when you run browser add:
Android project created with cordova-android#4.0.0-dev
And your cordova-crosswalk-engine. Mine says: c0.7.1
Those are all inter-related and may lead to weird errors.