Which command is used to install a Node.js package globally?
- npm global install
- npm i -g
- npm install -g
- npm add -g
To install a Node.js package globally, you should use the npm install -g command. This makes the package available for use across different projects. The other options may not work as expected or are not the recommended way to install packages globally.
Loading...
Related Quiz
- What is the role of the extends property in an ESLint configuration file?
- In Express.js, the all method can be used to handle all HTTP methods, and it is equivalent to the ______ method in terms of functionality.
- In a Write-Around caching strategy, the data is written directly to the ______, bypassing the cache.
- In Express.js, how can you handle errors occurring in asynchronous code within a route handler?
- You are tasked with evolving the schema of a critical, high-traffic database while minimizing downtime and data inconsistency. What strategies would you employ to safely apply schema migrations?