How do I uninstall a package installed using npm link?

前端 未结 5 1935
被撕碎了的回忆
被撕碎了的回忆 2020-12-22 15:42

When installing a node package using sudo npm link in the package\'s directory, how can I uninstall the package once I\'m done with development?

n

5条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-22 16:27

    The package can be uninstalled using the same uninstall or rm command that can be used for removing installed packages. The only thing to keep in mind is that the link needs to be uninstalled globally - the --global flag needs to be provided.

    In order to uninstall the globally linked foo package, the following command can be used (using sudo if necessary, depending on your setup and permissions)

    sudo npm rm --global foo
    

    This will uninstall the package.

    To check whether a package is installed, the npm ls command can be used:

    npm ls --global foo
    

提交回复
热议问题