Git Product home page Git Product logo

Comments (11)

jcartledge avatar jcartledge commented on June 21, 2024

Thanks for the report. This looks like the same thing @carettacaretta reported at #20 (comment).

I can't reproduce it here, so forgive me if I ask some obvious/stupid questions:

  • Does node run in the terminal? What is the output of node -v?
  • If yes, how did you install node? Homebrew, or another way?
  • What is the output of which node?

Uh - not sure what else to look for at this point. We'll work this out, but I'm going to need your help.

from sublime-worksheet.

lpand avatar lpand commented on June 21, 2024

@jcartledge definitely which('node') returns None when _spawn is invoked, but from terminal

> python
>>> import pexpect as pex
>>> pex.which('node')
'/usr/local/bin/node'
>>>
> node -v
v0.10.0
> which node
/usr/local/bin/node

If i remember correct i used nave, nave usemain latest to install node.

Yesterday night it worked at some point, but today the problem is still there.

Thanks for your work, awesome plugin.

from sublime-worksheet.

timonwong avatar timonwong commented on June 21, 2024

@carettacaretta
Because Sublime Text strip /usr/local/bin (at least) from PATH environment variable(/usr/local/bin seems only accessible from terminal), so pexpect cannot find it.
You can change your worksheet.sublime-settings accordingly, in order to get it work:

        "JavaScript": {
            // Here we use absolute path for node
            "cmd": "/usr/local/bin/node -e \"require('repl').start('node> ')\"",
            "prompt": ["node> ", "\\.\\.+ "]
        }

from sublime-worksheet.

lpand avatar lpand commented on June 21, 2024

@timonwong

i've checked, you're right and the solution works 😆.
Thank you.

from sublime-worksheet.

jcartledge avatar jcartledge commented on June 21, 2024

That will work, but it would be better if you didn't have to hardcode it.

I'm not sure why, but /usr/local/bin is always in my path, no matter how I start ST - I thought maybe it made a difference if it was started from terminal rather than GUI, but not so.

I think it should be possible to append "/usr/local/bin" to os.environ["PATH"]. I'll check it out and see if it works so people don't have to hack their config to get it working.

from sublime-worksheet.

kosii avatar kosii commented on June 21, 2024

For me /usr/local/bin is on the path if I start Sublime from the terminal with /Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl, but it's not present if Sublime is started by double-clicking on the Sublime application icon.

from sublime-worksheet.

u840903 avatar u840903 commented on June 21, 2024

Not sure if it's still of importance but I installed Node via Homebrew and it runs in the terminal.

> node -v
v0.10.12
> which node
/usr/local/bin/node

Happy to help!

from sublime-worksheet.

jcartledge avatar jcartledge commented on June 21, 2024

Does anyone who has this problem want check if the path branch resolves it? Thanks.

from sublime-worksheet.

jcartledge avatar jcartledge commented on June 21, 2024

I've merged my attempt at a fix for this into master but it's not in a release yet. I'm not going to close until someone can verify that it solves the problem for them.

from sublime-worksheet.

u840903 avatar u840903 commented on June 21, 2024

Path branch on OSX 10.8.4 and ST2.0.1 resolves the bug.

Javascript

var foo = function(bar){
    return bar;
}
foo('foobar');

Javascript after eval.

var foo = function(bar){
    return bar;
}
// > undefined

foo('foobar');
// > 'foobar'

from sublime-worksheet.

jcartledge avatar jcartledge commented on June 21, 2024

Great, thanks. I'll try to wrap it up today.

from sublime-worksheet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.