全局相关

# 添加全局包

npm i yarn -g

# 查看全局安装了哪些包

npm list -g --depth 0

~~~

+-- @hs/[email protected]

+-- [email protected]

+-- [email protected]

+-- [email protected]

`-- [email protected]

~~~

注: 如果不加 --depth 0,则会展示全部层级

如: 

~~~

 +-- [email protected]

| | +-- [email protected]

| | +-- [email protected]

| | | +-- [email protected]

| | | +-- [email protected] deduped

| | | +-- [email protected]

| | | | `-- [email protected]

| | | +-- [email protected]

....

~~~

# 查看全局是否安装了某个包

npm ls yarn -g

如果有就会打印如:

~~~

`-- [email protected]

~~~

注: 如果不加-g就表示查看当前文件下

# 移除全局包

npm uninstall yarn -g

你可能感兴趣的:(全局相关)