我正在使用自制软件升级纱线,我已经在使用nvm,但是自制软件会自动为我安装节点11。
当我输入which node
时,可以看到我仍在使用节点8的nvm版本。
那我该如何正确删除我的自制软件安装的节点11。
我知道我可以输入$ brew uninstall node
,但是会有副作用吗?
我不能简单地输入$ brew uninstall node
,它对我来说显示错误。
Error: Refusing to uninstall /usr/local/Cellar/node/11.12.0
because it is required by yarn, which is currently installed.
You can override this and force removal with:
brew uninstall --ignore-dependencies node
当我使用yarn执行package.json脚本时,我用homebrew重新安装了yarn之后,它向我显示此错误:
npm WARN lifecycle The node binary used for scripts is
/var/folders/yw/wsrk1t713x13_5q52_dgjy_80000gn/T/yarn--1554024356098-0.4116378701167074/node but npm is using
/Users/wangzhiyong/.nvm/versions/node/v8.15.1/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary
npm was executed with.
重新安装无法正常进行,我认为我只是破坏了环境。
答案 0 :(得分:0)
尝试以下一项:yarn config set scripts-prepend-node-path /usr/local/bin/node