ionic-cli - Error: unable to get local issuer certificate - ionic-framework

I'm using the ionic-cli v3.9.2 to create a project like this:
ionic start cutePuppyPics
But I'm getting the following error:
? What starter would you like to use: tutorial [INFO] Fetching app
base (https://github.com/ionic-team/ionic2-app-
base/archive/master.tar.gz) × Downloading - failed! Error: unable to
get local issuer certificate
I am behind a corporate firewall but I've correctly configured npm and git to use the proxy already (I was able to install cordova and ionic through npm with no issues).
Any clues?
#ionic/cli-plugin-proxy : 1.4.6
#ionic/cli-utils : 1.9.2
ionic (Ionic CLI) : 3.9.2

I have met the same issue. set NODE_TLS_REJECT_UNAUTHORIZED=0 solved my problem

In CMD
set NODE_TLS_REJECT_UNAUTHORIZED = 0
will solve your problem.
Problem is NODE_TLS_REJECT_UNAUTHORIZED is highly unsecure so you have to unable it.

Related

Erro installing cordova ionic

I'm a beginner in ionic and I want to install it and I got some problems
I tried
npm install ionic -g cordova
I got
npm WARN deprecated superagent#4.1.0: Please note that v5.0.1+ of
superagent removes User-Agent header by default, there
fore you may need to add it yourself (e.g. GitHub blocks requests without
a User-Agent header). This notice will go awa
y with v5.0.2+ once it is released.
C:\Users\Acer\AppData\Roaming\npm\cordova ->
C:\Users\Acer\AppData\Roaming\npm\node_modules\cordova\bin\cordova
C:\Users\Acer\AppData\Roaming\npm\ionic ->
C:\Users\Acer\AppData\Roaming\npm\node_modules\ionic\bin\ionic
+ ionic#5.2.4
+ cordova#9.0.0
updated 2 packages in 117.964s
I configured the proxy to localhost:8888
but when I tried to start and app I got
V Preparing directory .\myApp - done!
\ Downloading and extracting tabs starter
[ERROR] Network connectivity error occurred, are you offline?
If you are behind a firewall and need to configure proxy settings,
see: https://ion.link/cli-proxy-docs
Error: connect ECONNREFUSED 127.0.0.1:8888
/ Downloading and extracting tabs starter
Terminer le programme de commandes (O/N) ? o
It stay like this for a long time without any progresse,I'l using 32bits windows 7 and I installed nodjs and npm

Could not find cordova integration in the default project

following the official getting started tutorial I get the following error when I try to deploy the application in my phone using this command: ionic serve --devapp (it works on browser):
[ERROR] Could not find cordova integration in the default project.
I get this error both on Windows and MacOS.
I'm using Node 6.4.1 and Ionic CLI 4.10.3
Does the official tutorial missing something?
I had the same issue. In fact, with the default project, you have to copy the cordova assets to prepare the native build for mobile.
You can find more info here : Ionic documentation
Try this :
ionic cordova prepare
And then go again with :
ionic serve --devapp
The accepted answer is 100% correct .
But the reason why this occurred for me was that somehow the default was capacitor and not cordova.
so first i ran
ionic integrations disable capacitor
then ran
ionic cordova prepare
which solved my issue

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.

Ionic config directory error. (How to solve)

I have a issue using ionic on my mac. I've cloned my repo and started it with ionic serve. But if I use control C and stop the command ant start it again I get this error "Cannot read property 'IONIC_CONFIG_DIRECTORY' of undefined".
Same problem here. Found the solution: https://forum.ionicframework.com/t/ionic-commands-not-working-after-update-ionic/146492/3
Solution:
npm uninstall ionic cordova
npm install ionic cordova

cordova add plugin - unable to access

I am trying to add a plugin to Cordova via
cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git
git itself seems to run fine. Running the following works:
git clone "https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git" "D:\Temp\plugman-tmp1390234462383"
This is what is used in plugins.js line 43 (var cmd = util.format(...)).
The error I receive using the cordova plugin add ... is:
Calling plugman.fetch on plugin "https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git"
Fetching plugin from "https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git"...
Fetching plugin via git-clone command: git clone "https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git" "D:\Temp\plugman-tmp1390235833828"
C:\Users\myUser\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:126
throw e;
^
Error: Fetching plugin failed: Error: Command failed: Cloning into 'D:\Temp\plugman-tmp1390234462383'...
fatal: unable to access 'https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git/': Failed connect to git-wip-us.apache.org:443; No error
at C:\Users\myUser\AppData\Roaming\npm\node_modules\cordova\src\plugin.js:90:41
at _rejected (C:\Users\myUser\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:808:24)
at C:\Users\myUser\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:834:30
at Promise.when (C:\Users\myUser\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:1079:31)
at Promise.promise.promiseDispatch (C:\Users\myUser\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:752:41)
at C:\Users\myUser\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:574:44
at flush (C:\Users\myUser\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:108:17)
at process._tickCallback (node.js:415:13)
Any idea?
Some more information:
I am going through a proxy, but I set this for git and for npm. I installed Cordova via "npm install cordova" and the project via "cordova create TestApp", I added platforms via "cordova platform add android" and I can run the app on the emulator.
I even tried "phonegap local plugin add https..." with the same result.
All that is missing for me is to add plugins.
Sometimes a Cordova update will cause problems with npm and will corrupt the "cordova cache" that NPM uses to quickly download different Cordova versions. I know there were problems with the server pushing the latest Cordova plugins to NPM, so maybe this is why you're having trouble.
I'd suggest deleting /AppData/Roaming/npm/node_modules/cordova direct in its entirety, than installing a fresh new copy with npm install -g cordova. This shouldn't remove any of your Cordova projects, it will just download a fresh set of the tools. When you run cordova commands, it might take longer the first time since the tools will have to go to the git repo's and fetch the content fresh.
Tried clearing the cordova cache by deleting the folder as suggested by #mbillau but that didn't help. I search for the plugin where I was getting the error and tried installing through command line but got the same error message. Finally the solution that worked for me:
open important files in your IDE
open Cordova plugins
replace all "https://git-wip-us.apache.org/repos/asf/" with "https://git.apache.org/"
and it worked perfectly.
Replace "git-wip-us.apache.org/repos/asf7" with "github.com/apache/"
Like #Max said.
Checking the apache site (either https://git-wip-us.apache.org/repos/asf/, https://gitbox.org/repos/asf/, or https://git.apache.org/) I only see commit logs instead of the sources.
The sources can be found on GitHub. This worked for me:
cordova plugin add https://github.com/apache/cordova-plugin-device.git