dojo / cli

:rocket: Dojo - command line tooling.
http://dojo.io
Other
25 stars 34 forks source link

Issue with offline dojo and host resolve #284

Open gardiol opened 5 years ago

gardiol commented 5 years ago

Bug

I am using Dojo on a completely offline machine. It has a network, but the network is a private network with no internet, which had not and never will have any internet.

I "installed" dojo on an on-line machine, locally, then tarred up the archive and moved via USB key to the offline one. I can successfully create build and serve applications.

The problem is, when running at least the following commands:

dojo (no arguments)
dojo create app
dojo build --watch --serve

i always get a lag (a few seconds) and the following error message: "There was an error searching npm: request to https://registry.npmjs.org/-/v1/search?text= failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org:443"

The error (sorry for typos, i copied by hand) is clearly because the pc is offline and the name cannot be resolved. But it's annoying because it add a few seconds delay each time. Can this behaviour be eliinated or disabled in some way?

Environment is Linux, offline pc is CentOS 7.

Package Version: Dojo/cli@5.0.0 Dojo/cli-build-app@5.0.4 nodejs-10.15.3

Code

Expected behavior:

Actual behavior:

JamesLMilner commented 5 years ago

Hi @gardiol, thanks for raising this. We can reproduce this issue, we'll look into fixing it.

agubler commented 4 years ago

@JamesLMilner did you get anywhere with this?

JamesLMilner commented 4 years ago

I believe that this issue is actually an example of some of the issues we had in #275. Me and @matt-gadd aimed to improve this in #283.

If I delete the command cache provided by configstore (generally found in ~/.config/) then go offline and run dojo you'll see the finish time is much faster than the time you described. We do still have the error message you described and perhaps we should print something a bit more user friendly there if possible.

Screenshot_20191216_110734

As such I believe the issue of speed is resolved, but if you believe otherwise please feel free to follow up.

prstorero commented 4 years ago

Hi there, I was directed here by Matt to post my current problem.

Is it possible to run "dojo create app" through a proxy? When attempting to create an app on my work system, we end up with

There was an error searching npm: request to https://registry.npmjs.org/-/v1/search?text=%40dojo%2Fcli-&size=20&from=0&quality=0.65&popularity=0.98&maintenance=0.5 failed, reason: connect ECONNREFUSED 104.16.19.35:443. Then at the end of the process you get Running npm install failed npm install exit code: 1, which maybe be due to the connection refused issue.

After trying a bunch of things, we decided to see if curl for the same url would work, and when run with our proxy, it does. But we haven't figured out anything for allowing that connection during the dojo create app process. We also discovered that the bae of that url is inserted internally in some of the dojo files that a coworker found. He did a find and replace on all of them to try http instead of https, which didn't work.

I'll be happy to provide any additional details anyone may require.