About building an ionic environment in a Proxy environment

Asked 1 years ago, Updated 1 years ago, 130 views

I'm trying to create an app using ionic, but

under proxy environment
ionic start myapp

An error occurs when you execute the command in .

Enter a description of the image here

Based on the contents of the error, I think there is an error in the proxy configuration.
The following settings have also been added to .npmrc:

proxy=http://XXXXXX:8080/
https-proxy=http://XXXXXXX:8080/
registry=http://registry.npmjs.org/
strict-ssl=false

You can use npm to install other tools such as gulp without any problems.
Tools such as git have already been proxy-configured, so it can be used without any problems.

Your PC environment is as follows:

Cordova CLI: 6.3.0
Ionic CLI Version: 1.7.16
Ionic App Lib Version: 0.7.3
ios-deploy version: 1.8.6 
ios-sim version: 5.0.8 
OS: Mac OS X El Capitan
Node Version: v4.4.7
Xcode version: Xcode 7.3.1 Build version 7D1014 

What kind of cause can you think of here?

javascript node.js cordova npm

2022-09-30 21:17

1 Answers

The Requests module is giving an error.

The following environment variables are detected by request:

HTTP_PROXY/http_proxy
HTTPS_PROXY/https_proxy
NO_PROXY/no_proxy

README

in Requests

So it seems that you can set these environment variables, but what is the current situation?

 echo "$HTTP_PROXY, $http_proxy, $HTTPS_PROXY, $https_proxy, $NO_PROXY, $no_proxy"

and so on.

Note:

For environment variables such as

http_proxy

.npmrc settings are valid only for npm.
In contrast, environment variables such as http_proxy are referenced by many tools and follow their settings.
The above README shows that ionic (reques module used by ) also refers to these environment variables.
(Please investigate the behavior and setting of environment variables in Unix separately.)

The error in the question is

ENOTFOUND http http:80

Therefore, attempts to resolve the hostname http have failed.
In other words,

export http_proxy=http://http/

You may have configured (for example, ~/.profile).
To temporarily set the environment variable and run the command, use the

http_proxy=http://example.com/ ionic start myapp

You can do this, but http_proxy etc. refer to other programs, so
You must investigate the current situation and make changes to the settings.


2022-09-30 21:17

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.