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"
end
cmd = inspec.command("#{npm} ls --json #{@package_name}")
cmd = inspec.command("sh -c '#{npm} ls --json #{@package_name}'")
@info = {
name: @package_name,
type: "npm",