atom-script: Got error when I try to run js code

I just installed the script plugin today on the latest atom editor 0.69.

I have a file named test.js, I defined a test function like it

function test() {
    console.log('hello world');
}
test();

Then I hit cmd-i, I got an error

 execvp(): No such file or directory

Tried in the readme shell script ls example, it did not work for me at all. I am using the script@2.0.2 , is there any special setup to use this plugin? thanks

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 52 (17 by maintainers)

Most upvoted comments

W10 +1

It seems to work randomly. Even if I run it from the command line.

You’ve truly made me curious. You can also modify your init script:

screen shot 2014-03-11 at 2 27 15 pm

miromarszal commented 6 days ago

A workaround for Win10:

Right-click on the Atom shortcut
Go to "Properties"
Replace the path in "Target" with cmd /C atom

A side effect: the terminal window stays open.

Hi. Let us consider this proposal. How about creating a BAT file?..

  1. Right-click on the Atom shortcut
  2. Go to “Properties” of the shortcut
  3. Copy the entry in “Target”
  4. Open a text editor such as Notepad
  5. Put in this text file the “Target” copied in (3)
  6. Insert the line " @echo off " before it.
  7. Save & close the text file as (example) openAtom.bat in the same directory as “Target”
  8. Replace the “atom.exe” with “openAtom.bat” in the “Target” of (3).

The command prompt does open,but does not remain open.

Helpful?

  • Dan

Alright, updated env suggestion in 655ccfb35e1e4d4c4b15267c8bae9b7d9be8256e.

On to launchctl. I covered this a bit in #5, but issues/PRs clearly aren’t the documentation.

I don’t have Alfred, so if this doesn’t work let me know.

What you’ll want to do is setup launchctl to use the PATHing from your normal setup. This can either be done programmatically:

launchctl setenv <key> <value>

or in ~/.launchd.conf:

$ cat  ~/.launchd.conf
setenv KEY 'value'

Someone on StackOverflow has a ridiculous solution for changing launchctl as your export vars in bash.

Let me know what you think of these, and feel free to update the README. I’m always happy to review and merge PRs!

Whoa, wait. I just re-read what you said about the shell script example. Bash doesn’t work either?