我试图卸载nodejs 和 npm,但是虽然我可以看到当前版本,但我无法卸载它。
输出locate-w npm:
home/juliana/snap/notepad3/common/.wine/drive_c/windows/system32/gecko/plugin/npmshtml.dll
/home/juliana/snap/notepad3/common/.wine/drive_c/windows/syswow64/gecko/plugin/npmshtml.dll
/snap/wine-platform/128/opt/wine-devel/lib/wine/npmshtml.dll.so
/snap/wine-platform/128/opt/wine-devel/lib/wine/fakedlls/npmshtml.dll
/snap/wine-platform/128/opt/wine-devel/lib64/wine/npmshtml.dll.so
/snap/wine-platform/128/opt/wine-devel/lib64/wine/fakedlls/npmshtml.dll
/snap/wine-platform/128/opt/wine-stable/lib/wine/npmshtml.dll.so
/snap/wine-platform/128/opt/wine-stable/lib/wine/fakedlls/npmshtml.dll
/snap/wine-platform/128/opt/wine-stable/lib64/wine/npmshtml.dll.so
/snap/wine-platform/128/opt/wine-stable/lib64/wine/fakedlls/npmshtml.dll
/snap/wine-platform/128/opt/wine-staging/lib/wine/npmshtml.dll.so
/snap/wine-platform/128/opt/wine-staging/lib/wine/fakedlls/npmshtml.dll
/snap/wine-platform/128/opt/wine-staging/lib64/wine/npmshtml.dll.so
/snap/wine-platform/128/opt/wine-staging/lib64/wine/fakedlls/npmshtml.dll
/usr/share/code/resources/app/extensions/npm
/usr/share/code/resources/app/extensions/npm/README.md
/usr/share/code/resources/app/extensions/npm/dist
/usr/share/code/resources/app/extensions/npm/images
/usr/share/code/resources/app/extensions/npm/package.json
/usr/share/code/resources/app/extensions/npm/package.nls.json
/usr/share/code/resources/app/extensions/npm/resources
/usr/share/code/resources/app/extensions/npm/dist/main.js
/usr/share/code/resources/app/extensions/npm/dist/nls.metadata.header.json
/usr/share/code/resources/app/extensions/npm/dist/nls.metadata.json
/usr/share/code/resources/app/extensions/npm/images/npm_icon.png
/usr/share/code/resources/app/extensions/npm/resources/dark
/usr/share/code/resources/app/extensions/npm/resources/light
/usr/share/code/resources/app/extensions/npm/resources/dark/continue.svg
/usr/share/code/resources/app/extensions/npm/resources/dark/debug.svg
/usr/share/code/resources/app/extensions/npm/resources/dark/prepostscript.svg
/usr/share/code/resources/app/extensions/npm/resources/dark/refresh.svg
/usr/share/code/resources/app/extensions/npm/resources/dark/script.svg
/usr/share/code/resources/app/extensions/npm/resources/light/continue.svg
/usr/share/code/resources/app/extensions/npm/resources/light/debug.svg
/usr/share/code/resources/app/extensions/npm/resources/light/prepostscript.svg
/usr/share/code/resources/app/extensions/npm/resources/light/refresh.svg
/usr/share/code/resources/app/extensions/npm/resources/light/script.svg
/usr/src/linux-headers-5.0.0-13/include/xen/interface/xenpmu.h
/usr/src/linux-headers-5.0.0-15/include/xen/interface/xenpmu.h
答案1
你到底是如何安装 nodejs 的?你用过 apt 还是类似 snap store 的东西(因为我看到你安装了一些其他 snap 包)。
更好的运行命令是which
,它将返回被调用的可执行文件的路径,因此类似which node
或的命令which npm
会更有用。此外,由于我假设您实际上使用了 snap 包,所以sudo snap list
会很有帮助。
如果您确实正在使用 snap 包,那么您可能需要sudo snap remove node
。
附注:请避免以 root 身份登录并使用它。您可以使用 sudo 执行管理任务,因此请充分利用它并习惯更好、更安全的做法。
此外,如果您希望删除它以便可以更新到较新的版本,请查看此 github 页面,其中包含通常推荐的安装节点的方法。