When you run npm install --global
, this is usually (not always) for packages that expose a CLI. If this is the case you can use the handy UNIX which
command to find out where it is.
For example, by default when you install NodeJs, npm
is intsalled as a global package.
Therefore you are virtually guaranteed to find it, like so:
$ which npm
/home/bguiz/.nvm/versions/node/v12.16.1/bin/npm
Your path will depend on a number of factors, such as your operating system, which method you used to install node, currently set environment variables, symlinks, etc. Whatever it is, ls
that path without the bin/npm
at the end.
$ ls /home/bguiz/.nvm/versions/node/v12.16.1/
bin CHANGELOG.md include lib LICENSE README.md share
This is the "global" node directory.
Back to your original question, about where ng
is installed.
Add node_modules/${PACKAGE_NAME}
to the global node directory, and ls
that.
In my example this would be:
$ ls /home/bguiz/.nvm/versions/node/v12.16.1/lib/node_modules/ng
ls: cannot access '/home/bguiz/.nvm/versions/node/v12.16.1/lib/node_modules/ng': No such file or directory
I do not have ng
installed globally, so the above ls
command fails. But in your case, you should see the contents of the ng
package installation.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…