-
Notifications
You must be signed in to change notification settings - Fork 269
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
Got error when I try to run js code #61
Comments
Right now the plugin is using If you do have node, but it's still not running, it may be an environment issue. Script relies on the environment variables that Atom loads with. Atom run from a shell is different than Atom run from the icon/Applications menu. Run As for the absolutely useless error message being passed to you, that needs fixing. Since we're using Atom's BufferedProcess we don't have direct access to node's child.stderr.on('data', function (data) {
if (/^execvp\(\)/.test(data)) {
console.log('Failed to start child process.');
// Let user know the executable was unavailable
}
// Other logic
}); An alternative for us of course is to check for the existence of the executable first. Not sure how I feel about that, but it may be necessary. |
Whoa, wait. I just re-read what you said about the shell script example. Bash doesn't work either? |
Well, I re-tested the shell script, I do have Maybe it needs a specific file structure? |
@mattma I'm able to run the function you posted above and get the appropriate output both with and without saving the file as shown below. However, the issue you're experiencing is probably because you're launching atom from the dock and not via the command line using the |
@mattma Where are you running Atom from? The icon/Applications or from the console? |
Yes, from icon.Applications. How could I run from the console? Instruction please. I am experienced user of Sublime Text, and i think this plugin could essentially be the build tool for atom. :) |
@mattma you can launch Atom from your terminal. Open up a terminal window and type atom -h for more information. If it says something like command not found, go to the menu bar Atom > Install Shell Commands |
If you install the cli tools: You can run Make sure to fully quit Atom first.
👏 That would be awesome! We'd probably need a name change for that, but it's becoming clear that people want a unified output pane for running crud. |
First, it works as it advertised. 2nd, I do have atom apm installed in my machine. I think I do have atom command available, or I really do not have it. Anyway, after I tried that, it works great. Question, can this one run mocha command for testing? can I execute any cli command in there like |
Yay! Glad that works for you. We're going to update the README to make sure the cli vs. icon running is clear.
Mocha may be better suited to @tombell's https://github.com/tombell/test-status. However, I'm currently hacking away on the config settings right now so that you can change it to use your preferred command for each language.
You can run any cli commands that don't need input using a bash script. Keep in mind however that the current working directory that it's operating from is wherever Atom was opened from. |
Hey there, |
@aesarius - Thanks for poking me on this. I'll edit it now. |
No worries mate. |
Alright, updated env suggestion in 655ccfb. On to I don't have Alfred, so if this doesn't work let me know. What you'll want to do is setup
or in
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! |
Yet another method is setting up launchctl as part of your bash profile:
That would get executed on every single terminal that is opened though, so nevermind that one. |
Ok mate. |
Yeah ok this is rather interesting! |
Adding the stuff I need to To update the terminal you might need to use |
@hansrodtang I definitely don't know the best practice here. Has anyone seen a good discussion on the forums about this? |
For now I just add what I need to if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi to Seems like this is something Atom itself should fix/make more transparent to package developers since a properly equipped environment is essential to any programming tool. |
So I had a similar problem. I'm a mac noob, so this first bit may have been the wrong thing to do... I had put atom into its own folder inside /Applications; so /Applications/atom/atom.app. Atom ran fine, command-line worked...life seemed happy. When I tried to use this plugin I was getting the above error...checked my path by using plugin to run env...path looked like a real one, etc... Long story short, I removed atom from it's old location, and reinstalled as /Applications/atom.app. Now all is well :) |
I had the same issue in Ubuntu. Here's what I did to get it working:
to your config.json (ctrl shift p, config) You should now be able to run C# files saved as .csx files by pressing ctrl shif p then type r and hit enter. |
I've just worked around this issue on OSX. The way I solved it was by using the fix-path module to adjust my path when running from the app file. Hope this helps any other users with this issue. |
@jbavari How did you use fix-path for the script plugin? Is there a pull request or branch I can use? |
All of the discussion above seems Linux-centred. However, I'm happily running on W10 and I'm not entirely sure how I can start Atom from cmd, or with custom parameters on an icon, so the package would work. Any suggestions? |
W10 +1 It seems to work randomly. Even if I run it from the command line. |
@oddysee Wrapped up fix-path as an atom package. You should just be able to |
+1 @rgbkrk for # init.coffee
process.env.PATH = ['/usr/local/bin', process.env.PATH].join(':') but who knows what # init.coffee
process.env.PATH = [
"/usr/local/bin",
"/usr/bin",
"/bin"
].join(":") Less is more™ |
@naomik On Mac at least, alert(process.env.PATH) in your init.coffee and see what you get back. |
@rgbkrk yeah I still prefer to just set what's required. I do the same in my I generally hate relying on defaults because I can never remember what they are (and they're different on a lot of platforms). It's takes more time for me to look up defaults than it does for me to write what I actually need. |
Yeah, I prefer to use what's in my bashrc. The problem lies in how Atom is launched (or restarted after an upgrade...) 😒 |
You may use osx-env-sync to solve this problem on OS X for all applications in the proper way. |
Windows 7. I just went into MyComputer, chose Advanced System Settings, and pressed the button marked Environment Variables. Path is the top environment variable. Add ";C:\Python" to the end of the path (or the beginning; or whatever your python path is named). This is the environment that will be loaded every time a command prompt is spawned. |
Just to add another solution… there's also the env-from-shell package. |
I'm a pc user. I have downloaded atom recently, and want to set it up for Python coding. Though I have already downloaded 'Script' for run codes. but facing a great problem at the time of running . though the whole code is perfect, getting this message "Python is not recognized as an internal or external command". plz help me to solve this. |
A workaround for Win10:
A side effect: the terminal window stays open. |
Hi. Let us consider this proposal. How about creating a BAT file?..
The command prompt does open,but does not remain open. Helpful?
|
I should have thought about this one, works like a charm. |
Error If it should exist, add an issue on GitHub, or send your own pull request. |
can anyone help me with this issue please |
For Ubuntu and Linux Mint. Hello bhflm. Just ran into the same problem you had. This might help. If you installed the flatpack version from software manager Atom won't be able to find node. Uninstall Atom. Go to https://atom.io/ and download the .deb version. Once downloaded double click on the deb download. A popup window will open. Click on install package. Not only will Atom now recognize the path to node, your install is now less than 1GB (flatpack is 3.4GB) |
Workaroud for python3:
|
Nothing specific for conda? |
how to fix this |
if you have python installed from official release, you should not have issues. |
Prerequisites
DescriptionSteps to Reproduce
Expected behavior: normal atom welcome screenActual behavior: VersionsAtom: 1.60.0 x64 Stack TraceFailed to activate the script package
Commands
Non-Core Packages
Additional InformationHello all, |
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 itThen I hit cmd-i, I got an error
Tried in the readme shell script ls example, it did not work for me at all. I am using the [email protected] , is there any special setup to use this plugin? thanks
The text was updated successfully, but these errors were encountered: