Need help - ubuntu linux 14.04 LTS w/ xfce4 Atom build error - grunt file expecting Node in another directory


#1

hello –

i need some help. i’m trying to install the latest version of the Atom editor on ubuntu linux 14.04 LTS w/ xfce4 using the linux build instructions found on here.

everything seems to build fine; however, i keep getting stuck at this point, where i have to do –

sudo script/grunt install

when i do this, i get back –

/usr/bin/env: node: No such file or directory.

after getting this, i went and looked in the script/grunt file and found this on the very top line –

!#/usr/bin/env: node

so it’s expecting node to be in the /usr/bin/env. however, my install of node is not there. i installed node using the final method in this article with instructions for installing node on ubuntu, via the nvm version manager. my node install for node v.0.10.32 is in –

/home/faddah/.nvm/v0.10.32/bin/node

so i went in with vi and changed the script/grunt file so the first line is –

!#/home/faddah/.nvm/v0.10.32/bin: node

however, even though that is exactly where my node file and install is, when i try and run sudo script/grunt install, i get –

sudo: unable to execute script/grunt: No such file or directory.

i get this, even though i know the grunt file is in there, i just edited it in vi and saved it there.

can anyone help me with this so i can please complete my Atom editor install, using my node that is installed where it is? any help offered is most appreciated.

best,

– faddah wolf
portland, oregon, u.s.a.


#2

The very top line in script/grunt is:

https://github.com/atom/atom/blob/master/script/grunt#L1

Note the lack of the colon in the actual code. If your copy of the code has a colon, that might be what is causing the problem.

Additionally, /usr/bin/env isn’t a directory. env is a program and node is its parameter. Linux scripts often employ env in order to launch a script engine (such as node, ruby or python) from the environment-appropriate location rather than hard-coding a specific location like #!/usr/bin/ruby.


#3

hello @leedohm,

thank you for responding and offering help.

yes, you are correct – i am sorry for forgetting, but i knew that #!/usr/bin/env was a command line app to run and environment like node or ruby, i have used it in the past in scripts to run bash with #!/usr/bin/env bash - it just slipped my mind and i was not remembering it. sorry.

so i did as you instructed, and made the first line with no colon, just –

#!/usr/bin/env node

however, when i do so, save it, and then attempt to do as the original instruction for ubuntu linux install say –

sudo script/grunt install

i get back –

/usr/bin/env: node: No such file or directory

even though node is in there and the ubuntu linux 14.04 system sees if, if i do –

node -v

i get back –

v0.10.3

the exact version of node i installed with nvm and am running.

i also tried a simple file i made, greeting.js, a simple “Hello World” type file using console.log(...), and when i do node greeting.js, it runs the message just fine. so node seems to working o.k. in the system.

i also wanted to make sure i have grunt installed, so i ran npm list -g, and that showed i had grunt, grunt-cli and grunt-jasmine all installed, and i had installed them with npm using the -g option to make sure they were installed globally.

so i am at a loss here as to why this grunt script still will not run and why it still will not run. below is my install directory atom/script/grunt file listing –

#!/usr/bin/env node
var cp = require('./utils/child-process-wrapper.js');
var fs = require('fs');
var path = require('path');

// node build/node_modules/.bin/grunt "$@"
var gruntPath = path.resolve(__dirname, '..', 'build', 'node_modules', '.bin', 'grunt') + (process.platform === 'win32' ? '.cmd' : '');

if (!fs.existsSync(gruntPath)) {
  console.error('Grunt command does not exist at: ' + gruntPath);
  console.error('Run script/bootstrap to install Grunt');
  process.exit(1);
}

var args = ['--gruntfile', path.resolve('build', 'Gruntfile.coffee')];
args = args.concat(process.argv.slice(2));
cp.safeSpawn(gruntPath, args, process.exit);

if you could offer any more help as to why this is still happening, please, i would greatly appreciate it.

best,

– faddah wolf
portland, oregon, u.s.a.
github.com/faddah


#4

Part of the issue is that this command:

sudo script/grunt install

and this command:

node -v

run in different user contexts, with potentially different environments. Have you tried running:

sudo node -v

? I bet your nvm configuration doesn’t extend to the root user. (This is a common problem with rvm the Ruby tool that I understand nvm was based upon.)


#5

hello again, @leedohm,

thank you for responding again. you are correct, of course, the nvm install i have does not have access to root. sudo node -v produces -

sudo: node: command not found

so what are my options here to get this to work and get my install of atom and apm commands put into /usr/local/bin ? is my only choice to uninstall the nvm installs of node and re-install node with apt-get? i was warned away from that as i had read the apt-get package installs node as nodejs due to a package name conflict and there were other inconsistencies. is there a way to make the nvm install accessible to root?

i also tried installing grunt locally to this atom project and running the script/grunt install that way, but then i get -

Running "install" task
Aborted due to warnings.

any help in making this work and complete the install, please, would be most appreciated.

best,

– faddah wolf
potland, oregon, u.s.a.
github.com/faddah


#6

Yes, you have to install a version of Node that is accessible to all users on your system. I would install it from apt-get and then it seems that there is this tidbit in the build instructions on how to solve the nodejs versus node issue:

/usr/bin/env: node: No such file or directory

If you get this notice when attempting to script/build, you either do not have Node.js installed, or node isn’t identified as Node.js on your machine. If it’s the latter, entering sudo ln -s /usr/bin/nodejs /usr/bin/node into your terminal may fix the issue.


#7

hi @leedohm,

all right, here’s what i did -

i went to the node.js site and downloaded the install for node.js on linux. i then followed these instructions for installing node.js on linux/unix.

i figured that was the best and most direct way to put node.js where it belongs on a linux system and not have to deal with work-arounds for apt-get installing it as ‘node.js’ instead of the standard ‘node,’ etc.

node.js v0.10.32 installed fine and all went well, and it installed npm and i updated that to v2.1.5 fine. they both get installed to my /usr/local/bin directory on ubuntu 14.04. and now root has access to noder. if i fun –

$ sudo node -v

it get back the expected –

v0.10.32

so i would think i would now be ready for the grunt script for installing atom and apm.

however, with all that done, when i now run –

sudo script/grunt install

… agan, into get the atom and apm commands installed to /usr/local/bin also. when i do, it seems to be running now, and after a while while it seems to running something, outputs the following -

Running “install” task

then it returns to the command prompt. then, at the command prompt, when i type –

$ atom

… i get back –

$ /usr/local/bin/atom: line 85: /home/faddah/.atom/nohup.out: Permission denied
nohup: failed to run command ‘/tmp/atom-build/Atom/atom’: No such file or directory

… and …

$ sudo atom

… returns …

$ nohup: failed to run command ‘/tmp/atom-build/Atom/atom’: No such file or directory

and in checking my /usr/local/bin directory, it shows atom is in there, but not apm.

and in both cases it just hangs there on those nohup: failed to run command, and have to ^C to get out of it.

do know what is going on here? i feel like i’m so close to getting this finally installed. sorry if i’m being annoying with all the rank newbie quetions and thank you for any help here.

best,

– faddah wolf
portland, oregon, u.s.a.
github.com/faddah


#8

This is the part where my Linux knowledge falls down :disappointed: You’re not being annoying and I appreciate the detail with which you lay out the issues you’re having … it saves a lot of back-and-forth :grinning:

It looks like you’re building Atom in a temp directory? Or is that normal for the Linux build? I’m not sure … and I don’t have a Linux machine readily available to test on.

Until I get a chance to dig deeper into this, you might want to look at the linux label in the Issues for Atom Core to see if anyone else is running into the same problems you are.

Anyone else have some suggestions? @abe? @DavidLGoldberg? (Sadly now I’m forgetting who of the regulars run Linux too … long day :tired_face:)


#9

@leedohm (and @abe & @DavidLGoldberg) -

i’ll be honest - i gave up. this was too much to deal with just try and get the atom and apm files, and their associated support files, via a grunt task file into the right directories.

i went for the too-easy fix. i had seen somewhere you folks started making *.deb package files of the Atom editor builds and stuck them up on a PPA server. i followed these instructions i found on the web, added the PPA server to the APT config, did a sudo apt-get update, and after that completed, then sudo apt-get install atom, and boom. there it was on my ubuntu linux 14.04 system. it’s running now and i’ve been adding packages and themes.

i do think the grunt file and such need to be looked at tweeked, or the general linux install needs to be re-thought to make it far simpler and easier to put things where they belong and need to go. my 2 cents, plain, in any case.

thank you for all the help, @leedohm. sorry i took the easy way out, but i’d much rather just be using the Atom editor on the linux platform than futzing around ad infinitum with the settings to just get the install to complete. but your kind help here was much appreciated.

best,

– faddah wolf
portland, oregon, u.s.a.
github.com/faddah


#10

I completely understand taking the easy way :grinning: Personally, I think this is the way that most people should install the application if they intend to just use it or even use it and develop the occasional package. It’s only those of us that want to hack on the internals that really need to be able to build the editor from scratch.

I think you’re right that the Linux build process needs to be double-checked. It probably hasn’t gotten as much loves as it really needs.

You’re welcome and I hope the rest of your experiences with the editor go easier :smile:


#11

@leedohm,

there is this Atom Editor issue #3924 i started before i copied it over to this support thread. perhaps you, @abe & @DavidLGoldberg can review it and see what can be done to improve & simplify the linux install to make it simpler/clearer.

best,

— faddah wolf
portland, oregon, u.s.a.
github.com/faddah


#12

Sorry for coming in after the war, I was off the internet for a few days back home. I’ll take a look at the issue when I get out of work.


#13

Ditto. What abe said. I’ll take a look at it tonight. I run Atom primarily on Mac, but know/use linux for our servers etc.

BTW. Grunt is old. Gulp is “the new hotness”. :stuck_out_tongue:
(so, while I’m somewhat kidding, there is actually some serious advantages of gulp should check it out).


#14

as a nØØB, i would lean probably more toward gulp myself, but not so much for its “new hotness,” but due to the fact it uses streams as the basis for what it does. grunt, however, has a far larger, established user base, however much gulp may be on its heels, and because it was first in its field as a js/node task manager, it has, i believe, close to four times the amount of associated plug-ins written for it over gulp. that might change, but that’s how it stands now.

but the point here is, it is a grunt task file that is supplied with Atom for the linux install to complete the final part of the install, and it doesn’t seem to be, well… completing.

best,

— faddah wolf
portland, oregon, u.s.a.
github.com/faddah


#15

Yeah, I actually read more on the train, and realized you were talking about that stuff. I’ll try to take a look at this again later, but I think yeah, shouldn’t have to use so much sudo. I would think apt-get for normal stuff. Nvm for node dev.

Also, I thought I read that atom included it’s own node, you trying to avoid that? I haven’t delved that deep into that part of it. I haven’t had to which is a good thing heh.

As for apm, there’s the built in gui driven (from the menu) “install apm tools” once your atom is working. Which may or may not work on linux when it’s all set up correctly heh.

I really, really don’t think anyone should have to touch nvm if they’re just trying to install atom and not work on code with various node versions. I could be very wrong.


#16

Have you tried running the command with --debug, --verbose or --stack option like this?

sudo script/grunt --debug --stack --verbose install

If you have a warning when running the script you should be able to get more details on the issue with this.

I’m no longer on Ubuntu but I find it weird that it installs and links to a binary located in /tmp, it should be in /usr/local which is the default for this kind of stuff.

The script source show that it install in /usr/local unless INSTALL_PREFIX is defined:

https://github.com/atom/atom/blob/master/build/Gruntfile.coffee#L63

It seems there’s some conditions as to where Atom is installed on Linux (https://github.com/atom/atom/search?utf8=✓&q=%2Ftmp), maybe there’s a track to follow here.

Also, have you tried using locate atom.sh or ls /tmp/atom-build/Atom to see if there’s something there?


#17

hi folks,

o.k., to follow up on few of the questions/points made here —

  1. a lot of this is moot at this point because, as i have said, i now installed from an apt-get package and it was working o.k. (more on that i a moment). the best thing i can tell you at this point is to try following the original instructions i link to above in this thread from the Atom github site on installing on an install of ubuntu linux 14.04 LTS yourself, and try and follow through with the final grunt file part of the install and see what happens for you. this should not be an impossible or hard task - you can install ubuntu on a usb thumb drive and run it from there.

  2. @DavidLGoldberg - i wasn’t “avoiding” the node.js that comes in atom - but can that be used for deep level projects outside of Atom? isn’t it just Atom’s engine for running itself with all the coffeescript files? what i did was install node.js first because i knew i’d want to be doing some javascript & node.js projects and i wanted the latest node.js to do that, so i installed that first, then i went on to install Atom. are you saying people shouldn’t be allowed to install their flavor of node.js if they install Atom?

  3. @DavidLGoldberg - i’m not quite sure what you mean by your mention of nvm. also, i don’t know who i should file an issue with over the fact that, as @leedohm found and pointed out in the thread above, nvm doesn’t give root full acccess to node, which is why i had some of the initial install errors. do i file that here with Atom editor issues? with nvm? both?

  4. @DavidLGoldberg - i will try, when i can, the install apm tools within Atom and see how that goes, thank you for the suggestion.

  5. @abe - i don’t know how it came up in this thread, originally with @leedohm, or where anyone got the idea, it wasn’t from me, but i never put the Atom install in the linux /tmp directory nor did i create a /tmp directory and put anything into it. i downloaded the Atom *.tar.gz for linux and it went into my ubuntu linux /home/faddah/Downloads directory, and from the command line, after extracting it, i started the install from there, all the way through up to the problem with the script/grunt file. as everything seemed to be installed to the /usr/local/bin directory, i didn’t think that would be a problem. should i have moved the Atom install directory elsewhere, and to where, before i started the install from the command line? if yes, the instructions need to be re-written to explicitly state this.

  6. @abe - i did not run the script/grunt file with --debug --stack --verbose as the instructions don’t say to and no one in this thread said to try it before this, and, as i say above, i’ve all ready installed Atom now with an apt-get package. is this something you want me to try? will it screw up my current Atom install if i try that?

  7. @abe - i don’t have locate, i have find. sudo find / -name "atom.sh" 2> /dev/null returns —

    /opt/atom/resources/app/atom.sh

and sudo ls /tmp/atom-build/Atom returns —

ls: cannot access /tmp/atom-build/Atom: No such file or directory

…but this is to be expected, because, as i say above, i never put the Atom install in a /tmp directory nor did i ever say i did. and sudo find / -name "atom-build" 2> /dev/null returns nothing.

  1. finally, my install of Atom got bork’d. :tired_face: the ubuntu update manager told me there was an update for Atom, from 0.139.0 to 0.140.0, through the PPA i put in for the Atom package, so i went for it. ever since then, every time i bring up atom, i can’t get the settings window or any file, and the dev tools immediately shows a loooooooooong stack trace at start up with things about conflicts with the package manager and the Atom start window. so i don’t know what to do at this point. maybe re-install and lose all the packages i’ve put in so far.

sigh. that’s where it stands. this is why i say the linux installs and updates need to be looked at and made far simpler/cleaner.

best,

— faddah wolf
portland, oregon, u.s.a.
github.com/faddah


#18

I finally got around to actually looking at the instructions you linked. While the Atom team is making a deb package available, to my knowledge they do not make it available on any particular PPA server yet:

The last update I see on this front is this comment by @kevinsawicki. Until the Issue above is resolved, any PPA should be considered “unofficial”.

I agree that the Linux installs and updates could be made cleaner. I’ll see if I can carve out some time this weekend with a VM and Ubuntu 14.04.

Also @faddah, I hope that this flood of feedback hasn’t been frustrating for you. Everyone is just excited to see if they can help fix things for you :grinning:


Suggested edit to installation documentation
Validating Atom's installation and build instructions for Ubuntu
Better to instal Atom on Linux via downloading .deb, or via PPA?
#19

oh @leedohm - please understand, i am very happy with you, @abe and @DavidLGoldberg all responding and trying to make this work better. open source FTW! but i just have been responding to clarify, in detail, any misconceptions they might have in the thread we’ve been having.

i knew the PPA i used for the apt-get install atom was not “officially” supported, but it worked for the version at the time and got me out the easy way with what was the latest version then, 0.139.0, so i wasn’t complaining.

in any case, as i said, my install of Atom via the PPA package got bork’d when i was offered an update throught the ubuntu update manager. see my last point in my previous response above. so now i probably have to re-install anyway, and have all my installed packages thus far lost. durn. oh well. onward. but yes, i would love to hear what happens when you look at this on an ubunut linux 14.04 LTS VM. please keep me informed.

best,

– faddah wolf
portland, oregon, u.s.a.
github.com/faddah


#20

well durn again - i did a complete –

sudo apt-get remove --purge atom

which removed the bork’d version, then tried re-installing with –

sudo apt-get install atom 

from the webupd8.com PPA i added, and it still is bork’d on launch, Atom editor version 0.140.0. here is the stack trace i get on launch –

TypeError: Cannot read property 'context-menu' of undefined
  at Package.module.exports.Package.activateResources (/opt/atom/resources/app/src/package.js:283:64)
  at /opt/atom/resources/app/src/package.js:207:19
  at Package.module.exports.Package.measure (/opt/atom/resources/app/src/package.js:157:15)
  at Package.module.exports.Package.activate (/opt/atom/resources/app/src/package.js:205:14)
  at PackageManager.module.exports.PackageManager.activatePackage (/opt/atom/resources/app/src/package-manager.js:404:21)
  at PackageManager.module.exports.PackageManager.activatePackages (/opt/atom/resources/app/src/package-manager.js:393:14)
  at PackageManager.module.exports.PackageManager.activate (/opt/atom/resources/app/src/package-manager.js:379:19)
  at Atom.module.exports.Atom.startEditorWindow (/opt/atom/resources/app/src/atom.js:526:21)
  at Object.<anonymous> (/opt/atom/resources/app/src/window-bootstrap.js:12:8)
  at Object.<anonymous> (/opt/atom/resources/app/src/window-bootstrap.js:23:4)
  at Module._compile (module.js:468:26)
  at Object.Module._extensions..js (module.js:486:10)
  at Module.load (/opt/atom/resources/app/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
  at Function.Module._load (module.js:318:12)
  at Module.require (module.js:373:17)
  at require (module.js:392:17)
  at window.onload (file:///opt/atom/resources/app/static/index.js:34:25)
 index.js:48

don’t know if anyone can help with this, being that it is “unofficial,” but thought you’d want to know.

best,

– faddah wolf
portland, oregon, u.s.a.
github.com/faddah