节点更新 npm 错误 - 缺少文件或目录

Node update npm error - missing file or directory

我一直在尝试更新我盒子上的节点版本。当我尝试通过 npm update node、npm install node 或 npm update node -g 执行此操作时,出现以下错误(路径取决于全局还是本地)

npm ERR! encent ENOENT: no such file or directory, chmod 'path/home/node_modules/nodebin/node'
npm ERR! encent ENOENT: no such file or directory, chmod 'path/home/node_modules/nodebin/node'

不确定无论如何发生此丢失文件错误时我将如何完成更新。

在搜索并尝试了不同的选项之后,对我来说最有效的选项是安装 nvm 并使用它来更新节点,这没有错误。