From 442fd527f16c0d6fb05b761a41a787fb2d2b9bc8 Mon Sep 17 00:00:00 2001 From: ilovezfs Date: Thu, 12 Oct 2017 04:03:16 -0700 Subject: [PATCH] node: fix npx issue with @ in path to node --- Formula/node.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Formula/node.rb b/Formula/node.rb index 68ecd27b8d..6718fd6ff2 100644 --- a/Formula/node.rb +++ b/Formula/node.rb @@ -60,6 +60,10 @@ class Node < Formula system "node", bootstrap/"bin/npm-cli.js", "install", "-ddd", "--global", "--prefix=#{libexec}", resource("npm").cached_download + # Fix from chrmoritz for ENOENT issue with @ in path to node + inreplace libexec/"lib/node_modules/npm/node_modules/libnpx/index.js", + "return child.escapeArg(npmPath, true)", "return npmPath" + # The `package.json` stores integrity information about the above passed # in `cached_download` npm resource, which breaks `npm -g outdated npm`. # This copies back over the vanilla `package.json` to fix this issue.