diff --git a/meta/classes-recipe/npm.bbclass b/meta/classes-recipe/npm.bbclass
index 7bb791d543..b1183a7ae3 100644
--- a/meta/classes-recipe/npm.bbclass
+++ b/meta/classes-recipe/npm.bbclass
@@ -300,7 +300,7 @@ python npm_do_compile() {
 
         # Pack and install the main package
         (tarball, _) = npm_pack(env, d.getVar("NPM_PACKAGE"), tmpdir)
-        cmd = "npm install %s %s" % (shlex.quote(tarball), d.getVar("EXTRA_OENPM"))
+        cmd = ["npm", "install", tarball] + shlex.split(d.getVar("EXTRA_OENPM") or "")
         env.run(cmd, args=args)
 }
 
diff --git a/scripts/lib/recipetool/create_npm.py b/scripts/lib/recipetool/create_npm.py
index 8c4cdd5234..4d316d9a55 100644
--- a/scripts/lib/recipetool/create_npm.py
+++ b/scripts/lib/recipetool/create_npm.py
@@ -97,14 +97,14 @@ class NpmRecipeHandler(RecipeHandler):
         bb.utils.remove(os.path.join(srctree, "node_modules"), recurse=True)
 
         env = NpmEnvironment(d, configs=configs)
-        env.run("npm install", workdir=srctree)
+        env.run(["npm", "install"], workdir=srctree)
 
     def _generate_shrinkwrap(self, d, srctree, dev):
         """Check and generate the 'npm-shrinkwrap.json' file if needed"""
         configs = self._npm_global_configs(dev)
 
         env = NpmEnvironment(d, configs=configs)
-        env.run("npm shrinkwrap", workdir=srctree)
+        env.run(["npm", "shrinkwrap"], workdir=srctree)
 
         return os.path.join(srctree, "npm-shrinkwrap.json")
 
