node: fix npx issue with @ in path to node

This commit is contained in:
ilovezfs 2017-10-12 04:03:16 -07:00
parent ca456a6237
commit 442fd527f1

View file

@ -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.