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

The 2.1.2 release on NPM includes a reference to a developer-local directory (and doesn't correspond to the Github tag) #35

Open
decadent opened this issue Jan 1, 2019 · 2 comments

Comments

@decadent
Copy link

decadent commented Jan 1, 2019

Hi. If you install the current (2.1.2) release from NPM, you'll get an error when Node-jxa runs osacompile:

osacompile: couldn't write to file /Users/john/code/node-jxa/deleteme.scpt: No such file or directory

The vars at the top of node-jxa.js look like this in that release:

const HEAD = 'window = this;\nObjC.import("stdlib");\ntry {\n ';
const TAIL = ';\n} catch (e) {\n console.log( e.message );\n $.exit(1); \n}\n$.exit(0);';
const OSA_JXA_CMD = 'osacompile';
const OSA_JXA_CMD_ARGS = ['-l', 'JavaScript', '-o', '/Users/john/code/node-jxa/deleteme.scpt' ];

You can check code in NPM's module package by getting the archive address with npm view node-jxa dist.tarball and downloading the archive.

My guess is you might want to republish the release if NPM allows that, because code for the release seems to be different here on Github.

@heathf
Copy link

heathf commented Feb 6, 2019

I experienced the same. Installing with npm leads to the 'deleteme.scpt' error you mentioned, and like you, it points to the developer's local user path. Copying the contents of GitHub's node-jxa.js over the top of the installation's script of the same name fixed it, but that shouldn't be necessary obviously.

@jopemachine
Copy link

You can use npm as it is by changing the package.json's dependencies as shown below.

(Because github's source code is imported as is.)

  "dependencies": {
    ...
    "node-jxa": "github:johnelm/node-jxa#v2.1.2"
    ...
  },

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

No branches or pull requests

3 participants