ioquatix / script-runner

This package will run various script files inside of Atom. It currently supports JavaScript, CoffeeScript, Ruby, and Python. You can add more.
http://atom.io/packages/script-runner
Other
62 stars 23 forks source link

Script-runner 2.2.1 no longer works on Atom 1.19 #80

Closed alsGitHub270 closed 7 years ago

alsGitHub270 commented 7 years ago

screen shot 2017-08-15 at 10 16 30 am With the auto update to 1.19, script-runner no longer works. Nor does platformio-ide-terminal(another post). I've tried uninstalling, re-installing, npm rebuild, apm upgrade, nothing seems to work . screen shot 2017-08-15 at 10 11 42 am

ioquatix commented 7 years ago

That's odd, it definitely works, because I'm using almost the same setup as you for testing.

Can you please try deleting ~/.atom/package/script-runner and then reinstall the package? Let me know if you have the same problem.

ioquatix commented 7 years ago

As an aside, don't use npm to build atom packages.

alsGitHub270 commented 7 years ago

I deleted the script-runner directory and re-installed script-runner from within atom. Exactly the same incompatible error message.

ioquatix commented 7 years ago

I checked my setup and most of the versions I have are the same as you. Something on your system might be causing an issue, but it's hard to know exactly what.

I only had this issue before when I tried to install script-runner with npm install accidentally, and it used the system node.js install instead of the one that comes with atom, and hence it got compiled with the wrong version.

ioquatix commented 7 years ago

Is it some how possible you have multiple copies of Atom installed?

alsGitHub270 commented 7 years ago

This problem occurred following the upgrade of atom to 1.19.0 on Monday. It has since been updated to 1.19.1 behind the scenes. Script-runner was installed prior to this. I installed it from the 'install' section of settings, so I don't know if it's installed via npm. I assume it is installed using apm. I have since uninstalled, deleted the folder as you suggested, and re-installed. The problem still exists. As an FYI, this started happening the same time the package platfomio-ide-terminal failed due to "some installed packages could not be loaded because they contain native modules that were compiled for an earlier version of Atom". I'm still trying to work this out.

ioquatix commented 7 years ago

In ~/.atom/packages/script-runner try deleting node_modules. Then, in that directory, run apm install. Restart Atom. See if it works.

alsGitHub270 commented 7 years ago

No effect: screen shot 2017-08-16 at 9 27 55 am

ioquatix commented 7 years ago

what's the output of apm config list

alsGitHub270 commented 7 years ago

Sorry, how to I get that apm config list?

ioquatix commented 7 years ago

run it in the terminal

alsGitHub270 commented 7 years ago

Sorry, brain cramp.

screen shot 2017-08-16 at 9 41 03 am

alsGitHub270 commented 7 years ago

I just saw something that may be revelant or not: I have my machine to run python 3.6 on a 'python' command. I see above python 2.7.

screen shot 2017-08-16 at 9 43 05 am

ioquatix commented 7 years ago
^_^ > apm config get python                  
/opt/local/bin/python2.7
^_^ > npm config get python
/opt/local/bin/python2.7
^_^ > /opt/local/bin/python2.7 --version 
Python 2.7.13

What about the version of /usr/bin/python2.7? Does that actually start python2.7?

From what I can see you are okay w.r.t. python versions.

ioquatix commented 7 years ago
npm config ls -l
; cli configs
long = true
user-agent = "npm/2.15.12 node/v7.10.0 darwin x64"

my version of npm is older than yours. I wonder if that's the issue?

alsGitHub270 commented 7 years ago

python2.7 works: screen shot 2017-08-16 at 9 54 18 am

npm, Could that have happened with the upgrade? I think yesterday I might have done an npm rebuild or npm install working on the platformio issue.

ioquatix commented 7 years ago

Essentially, the error you are receiving means that apm didn't use the version of Node included in the Atom app. It's building the packages with the wrong Node version. You nominally have one version of Node on your system, and another which is embedded within the Atom.app package. Basically, script-runner needs to be built with the one included with Atom, otherwise it builds the native libraries against the wrong API versions. Hence the error while trying to load node-pty which is the only native dependency I'm aware of. node-pty on your system appears to be getting built against your system's node install, but it should be using the one in the Atom app. Perhaps try downloading a fresh copy of Atom and put it in /Applications. Then trying mv ~/.atom /.atom-old and reinstalling all packages.

ioquatix commented 7 years ago

Another thing I'm not sure about is, perhaps the newer version of npm uses a cache, and it's not rebuilding the dependency because it gets it from your system cache (rather than building it fresh for Atom's node install). Perhaps check what packages you have installed globally, and make sure node-pty is not one of them (uninstall it if it is).

alsGitHub270 commented 7 years ago

didn't change anything. Now, I did not completely uninstall atom. I copied over what was displayed as the Atom icon into Applications (where my previous copy was). I moved the .atom to .atom-old. Now, no packages were displayed. I installed script-runner as the only package, and got the same error message: screen shot 2017-08-16 at 12 18 45 pm

alsGitHub270 commented 7 years ago

What happened when I moved .atom to .atom-old. It's totally gone, along with all the other packages that I had installed.

ioquatix commented 7 years ago

You can move it back, it contains user config for atom.

ioquatix commented 7 years ago

The problem must be with your system some how, did you check if node-pty was installed in your system?

ioquatix commented 7 years ago

Can you try updating all your globally installed packages?

sudo npm update -g

Then try reinstalling:

cd ~/.atom/packages/script-runner
rm -rf node_modules
apm install
alsGitHub270 commented 7 years ago

No change. But what I've notice is that with my problem, as well as a number of others, with platformio-ide-terminal also not working is that that package has two node.py for compiling(?)

screen shot 2017-08-17 at 9 45 19 am

With script-runner, there is no multiple builds. How can I tell if pty.node is build 49 instead of 53?

alsGitHub270 commented 7 years ago

Why is it that both my issues occurred after Atom 1.19 was released?

ioquatix commented 7 years ago

I think that some of the build tools were updated.

We had luck with npm update -g which seems to have updated some global dependencies which were causing problems here: https://discuss.atom.io/t/solved-cannot-find-module-build-release-pty-node/46224

alsGitHub270 commented 7 years ago

@ioquatix: I just changed the theme on Atom, and lo and behold, a button now to the right of the incompatible message was displayed to 'Rebuild Packages'. I had seen that comment in other comments, but could not see it on my machine. With the new theme, it became visible, and it rebuilt everything. Script-runner now runs like a champ. I appreciate your time and efforts on this. Al

ioquatix commented 7 years ago

Okay great :) I'm happy it is working for you now.