I'm trying to spawn "grep error /var/log/system.log" (equivalent to "grep 
error /var/log/syslog" on linux) via an "npm run" script.

Check this example program:

var spawn = require('child_process').spawn
var child = spawn('grep', ['error', '/var/log/system.log'], {stdio: 
'inherit'})
child.on('exit', process.exit)

I've added this as a script "test" in package.json.

I'm using nave to switch npm/node versions and in node 0.10.6/npm 1.2.18 
and below, running this with npm test produces a "permission denied" error:

grep: /var/log/system.log: Permission denied

But after node 0.10.7/npm 1.2.21 it works just fine.

I've checked the gid/uid and they're the same across both node versions, so 
I'm not really sure could be different that causes the permissions issue.

I've looked through node 
changes<https://github.com/joyent/node/compare/v0.10.6-release...v0.10.7-release>and
 npm 
changes <https://github.com/isaacs/npm/compare/v1.2.18...v1.2.21> between 
these two versions and nothing immediately jumps out as the cause of this 
change.

Anyone have any idea what's going on here?

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to