From c0b5b9cd4113e47e355f45a45198f3ea5d018f2d Mon Sep 17 00:00:00 2001 From: Clinton Wolfe Date: Tue, 1 Oct 2019 19:02:16 -0400 Subject: [PATCH] Fix for invocation when calling npm under sudo Signed-off-by: Clinton Wolfe --- lib/inspec/resources/npm.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/inspec/resources/npm.rb b/lib/inspec/resources/npm.rb index 8588efa99..6e659976f 100644 --- a/lib/inspec/resources/npm.rb +++ b/lib/inspec/resources/npm.rb @@ -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",