Fix for invocation when calling npm under sudo

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
This commit is contained in:
Clinton Wolfe 2019-10-01 19:02:16 -04:00
parent 549e3c196e
commit c0b5b9cd41

View file

@ -32,7 +32,7 @@ module Inspec::Resources
npm = "npm -g" npm = "npm -g"
end end
cmd = inspec.command("#{npm} ls --json #{@package_name}") cmd = inspec.command("sh -c '#{npm} ls --json #{@package_name}'")
@info = { @info = {
name: @package_name, name: @package_name,
type: "npm", type: "npm",