Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tns create command not using proxy set with tns proxy set #3824

Closed
enyineer opened this issue Aug 17, 2018 · 7 comments
Closed

tns create command not using proxy set with tns proxy set #3824

enyineer opened this issue Aug 17, 2018 · 7 comments
Assignees
Labels
Milestone

Comments

@enyineer
Copy link

enyineer commented Aug 17, 2018

Did you verify this is a real problem by searching the NativeScript Forum and the other open issues in this repo?

Yes

Tell us about the problem

Pacote fetch does not use the proxy that has been set via tns proxy set

Which platform(s) does your issue occur on?

Windows 10 Enterprise 2016 LTSB

Please provide the following version numbers that your issue occurs with:

  • CLI: 4.2.1
  • Cross-platform modules: Not related to issue
  • Runtime(s): Not related to issue
  • Plugin(s): Not related to issue

Please tell us how to recreate the issue in as much detail as possible.

  1. Set a proxy via tns proxy set
  2. Create a console log or debug the script in "%USERPROFILE%\AppData\Roaming\npm\node_modules\nativescript\node_modules\pacote\lib\fetchers\registry\fetch.js" at line 13 to look into the "opts" variable. It does not contain the proxy options that have been set before.
  3. This results in a fetch that does not use the proxy thus leading to a timeout if you are behind a proxy.
  4. It can be fixed temporarily by setting "opts.noProxy = false" and "opts.proxy = PROXY_URL".

It would be nice if the cli could set these properties correct so the user doesn't have to manually code the PROXY_URL into the dependency.

Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.

There is no own code involved.

@rosen-vladimirov rosen-vladimirov self-assigned this Aug 20, 2018
@rosen-vladimirov rosen-vladimirov added this to the 4.2.3 milestone Aug 20, 2018
@rosen-vladimirov
Copy link
Contributor

Hey @NicoEnking ,
Thanks for reporting this issue. I confirm it is an issue in the new implementation of the project creation that we are using in CLI 4.2.x
We'll include a fix in our code base for one of our next patch releases.

@enyineer
Copy link
Author

Thank you @rosen-vladimirov ! Glad to hear that this will be fixed soon.

@rosen-vladimirov
Copy link
Contributor

Hey @NicoEnking ,
Can you try the latest rc version of NativeScript CLI and comment if it resolves your issue? You can install it by executing:

npm i -g nativescript@rc

@enyineer
Copy link
Author

Yes I will try it in ~ 2 hours. Going to report to you wether it works now or not.

@enyineer
Copy link
Author

@rosen-vladimirov seems to work like a charm. Just another question. NativeScript is quite slow here while it's pretty fast on my private pc. Is there any reason why this happens and how to fix it? Some commands need minutes to execute. I could hunt it down to all $childProcess.exec() calls, for example in node-package-manager.js in line 130. This could be a related issue: nodejs/node#21632

@rosen-vladimirov
Copy link
Contributor

Hey @NicoEnking ,
Can you try the suggestion in this comment: #3683 (comment)
It looks like npm operations are slowed down by npm's internal logic for checking if there's a newer version.

@enyineer
Copy link
Author

Hello @rosen-vladimirov that also did the trick! Thanks a lot for your help. Appreciate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants