0

I'm running jsunpack.py, after installing all dependencies and setting the correct path, I decided to test it. I run it as python jsunpack.py test.htm and it works fine, now when I try to sudo it I get:

error: Error: Fatal error in decodeJS: [Errno 2] No such file or directory (probably you are missing "js" in your path)

Which leads me to think I don't have the path set up in root. So I sudo su root and I echo the path only to see that it is indeed there. I'm thoroughly confused, does it have something to do with permissions?

1 Answer 1

0

Permanent Solution

It seems that you need to add a directory to your environmental PATH variable. It is possible that you've gotten that variable installed using your .bashrc.

What happens if you do this:

sudo su -
bash /home/**user**/.bashrc
python jsunpack.py test.htm

If this works for you, then you've probably installed the PATH variable to your user's bashrc and not root's bashrc. To solve this you can open the user's .bashrc file and look though your PATH declarations:

cat ~/.bashrc | grep PATH

If you find a line that shows the path that you're looking for, copy and paste that PATH into your /root/.bashrc.


Single Time Solution

If you're really lazy, just:

cd /dir/with/jsunpack.py
python jsunpack.py test.htm

I am not familiar with jsunpack, but this may help resolve your issue.

1
  • Again, the same, running it without sudo works fine, but running it with sudo doesn't work (I changed the path in profile and in /etc/bash.bashrc. Still, sudoing doesn't work. Also, I'm trying to run this on cron. I ended up giving cron a Path for the js binaries. But still would like to know how to fix this.
    – Shelby. S
    Jul 16, 2012 at 20:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .