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

Using asset property still tries to download remotely #620

Closed
rikoe opened this issue May 8, 2019 · 2 comments
Closed

Using asset property still tries to download remotely #620

rikoe opened this issue May 8, 2019 · 2 comments

Comments

@rikoe
Copy link

rikoe commented May 8, 2019

I have downloaded the prebuilt node binary manually and I am providing it locally, but the nexe code still tries to download the remote binary regardless.

(Downloads from GitHub is blocked where I am running it.)

The problem is in download.ts:

async function fetchPrebuiltBinary(compiler: NexeCompiler, step: any) {
  const { target, remoteAsset } = compiler,
    filename = compiler.getNodeExecutableLocation(target)

  try {
    await download(remoteAsset, dirname(filename), compiler.options.downloadOptions).on(

Even though getNodeExecutableLocation(target) will correctly retrieve a local target specified using asset, the rest of the fuction ignores this and tries to download from remoteAsset anyway.

How can I work around this? I would really like to use nexe, but I cannot if I am forced to download the node binary remotely.

@rikoe
Copy link
Author

rikoe commented May 8, 2019

I have now gotten to the root of the issue, the problem was process.cwd():

The check below failed. I was running nexe from an npm scripts task and it seems cwd wasn't set to the folder I was running from for some reason.

    downloadExists = await pathExistsAsync(build ? src : exeLocation)

  if (downloadExists) {
    step.log('Already downloaded...')
    return next()
  }

If you can help with log entries for local assets it would be much appreciated to make debugging easier!

@calebboyd
Copy link
Member

Hmm Looks like the documentation got written before the feature was finished. file urls aren't supported it seems.

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

No branches or pull requests

2 participants