我想用brew on mac更新我的node.js版本,但是我有这个错误:
Error: This command updates brew itself, and does not take formula names.
Use 'brew upgrade <formula>'.
答案 0 :(得分:6)
此错误消息告诉您命令kernelSize = 3
kernelOffset = int(kernelSize / 2) # Assumes only odd-sized kernels
for x in xrange(len(A1)):
for y in xrange(len(A1[0])):
total = 0
for kx in xrange(kernelSize):
for ky in xrange(kernelSize):
offsetX = -kernelOffset + kx # Should give something in the range [-1, 1]
offsetY = -kernelOffset + ky
currentX = x + offsetX
currentY = y + offsetY
if currentX < 0 or currentX >= len(A1) or currentY < 0 or currentY >= len(A1[0]): # do nothing if "out of bounds"
continue
total += A1[currentX][currentY] * A2[kx][ky]
A3[x][y] = total
用于更新brew本身,如果您要更新节点,则需要运行brew update
。请注意区别:'更新'与'升级'。
您可能还想考虑使用Node Version Manager (NVM),这使得安装新节点版本变得非常简单,并允许使用单个命令在它们之间来回切换。
答案 1 :(得分:1)
这应该足以使用brew
升级Mac中的Node:
brew upgrade node
上述命令也会自动更新Homebrew。
==> Auto-updated Homebrew!