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
From your package with sindresorhus/is-installed-globally
https://github.com/sindresorhus/is-installed-globally
Usage:
const isInstalledGlobally = require('is-installed-globally');
// With `npm install your-package`
console.log(isInstalledGlobally);
//=> false
// With `npm install --global your-package`
console.log(isInstalledGlobally);
//=> true
I found this useful when I had to distribute prebuilt files with my package: How to publish a npm package with distribution files? With this package, I can check if the installation is local or global, and then use relative paths for local installations, as shown here.