Skip to content

Instantly share code, notes, and snippets.

@mape
Created August 3, 2010 08:07
Show Gist options
  • Select an option

  • Save mape/506030 to your computer and use it in GitHub Desktop.

Select an option

Save mape/506030 to your computer and use it in GitHub Desktop.
< tpryme> mape: Anyone ever have trouble running nodeprofile as sudo?
< mape> tpryme: just released it last night so haven't had a lot of people try it
< mape> what is the issue?
< tpryme> mape: I'm getting a "sudo: noprofile: command not found" despite "sudo whereis nodeprofile" returning "nodeprofile: /usr/local/bin/nodeprofile"
< mape> noprofile !== nodeprofile
< bradleymeck> noprofile != nodeprofile
< tpryme> mape: sorry typo. but yeah getting that error even with nodeprofile (not noprofile)
< mape> what about not sudo?
< tpryme> can't run as non-sudo since /usr/local/bin is root
< tpryme> Don't want to mess with privileges there.
< mape> k.. damit isaacs always escapes when you need him :/
< tpryme> I can change it just for nodeprofile but it should still run under sudo
< mape> tpryme: does it work if you just run it from /usr/local/bin/nodeprofile ?
< tpryme> tried that too with sudo
< tpryme> Didn't work
< mape> error?
< tpryme> Same as above with sudo
< tpryme> mape: Without sudo, I get Permission denied
< mape> tpryme: hmm, how can it say not a command if you are invoking the file?
< tpryme> mape: With sudo, same as if I ran it without specifying the prefix path
< mape> works really smooth now
< wattz> evening
< tpryme> mape: yeah, weird behavior
< mape> Hmm yeah..
< mape> tpryme: Yeah, if it can find it with which I don't see why it isn't working, what if you sudo cat the path it gives?
< mape> shows the code?
< tpryme> tpryme: yeah, that works
< tpryme> mape: yeah, that works
< mape> and ./usr/local/bin/nodeprofile ascript.js works?
< mape> *sudo
< tpryme> mape: No, I get verbatim "sudo: /usr/local/bin/nodeprofile: command not found"
< tpryme> mape: with verbatim cmd "sudo /usr/local/bin/nodeprofile app.js"
< mape> that works?
< mape> or that is command not found?
< tpryme> mape: No, I get the command not found
< tpryme> :P
< mape> and if you cat it?
< tpryme> mape: it cats perfectly
< mape> hmm..
< tpryme> mape: even whereis perfectly like I said earlier
< mape> I'm not the best of *nix people so don't really know what is causing it, npm setups all the aliases and whatnot so should work
< tpryme> mape: It works after I chmod +x'ed it
< mape> hmm k
< tpryme> mape: any tips on profiling a long-running non-returning app like a connect app?
< mape> tpryme: mind uninstalling it and installing it again?
< mape> pushed a new version to npm with +x, to see if that changes anything
< tpryme> mape: sure, 1 sec
< mape> thanks
< tpryme> mape: Hmm, now I'm getting "Error: Cannot find module './../lib/node/.npm/profile/0.0.5/package/bin/nodeprofile'"
< mape> on sudo npm install profile?
< mape> tpryme: and for long running things like a connect app you just make sure it listens to it, do nodeprofile connectapp.js and after you have tested around a bit you press ctrl+
< mape> *listens to it, ie it listen(port), and not use exports to run it through spark
< tpryme> mape: Installs fine. I get that when I run "sudo nodeprofile app.js"
< tpryme> mape: after installation
< mape> After you uninstalled it?
< tpryme> yeah
< tpryme> mape: sudo npm uninstall profile
< mape> yeah
< mape> should work, works here using npm
< mape> Sorry but need to get some sleep, work starts in 3h :S
< mape> But I'll ask isaacs about the Cannot find module issue and get back to you
< tpryme> mape: thanks, I'll let you know how things turn out
< mape> appriciate it :)
< mape> *appreciate even
< tpryme> mape: Think it may be a problem with scripts/preinstall.sh
< mape> the the entire npm install would fail
< tpryme> mape: "[: 1: /home/briannoguchi/sources/github/node/deps/v8/tools/linux-tick-processor.py: unexpected operator" when invoking npm install profile
< mape> *then
< mape> hmm
< mape> but yeah, gotta get sleep, will look at it later today
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment