How to tell if npm package was installed globally or locally

后端 未结 6 1323
遇见更好的自我
遇见更好的自我 2020-12-22 17:25

I am installing grunt, node, npm, bower, and grunt-cli on windows7.

The instructions say i should run the install commands with -g flag for global.

How can I

6条回答
  •  抹茶落季
    2020-12-22 17:52

    Use the list command with the -g flag to see all packages that are installed globally:

    npm list -g

    To check if a specific package is installed globally, you can provide the name of package (grunt in this case) as seen below:

    npm list -g grunt

    Or you can use grep to filter on package names:

    npm list -g | grep grunt

    Source: https://docs.npmjs.com/cli/ls

提交回复
热议问题