What does npm init command do and when would you use it?
Experience Level:
Junior
Tags:
npm
Answer
The command npm init
creates a file package.json.
You can use it whenever you need to create a new Node.js project. When the file exists, you can add a dependency or devDependency to the file and install it using npm.
Related npm job interview questions
-
Using npm, how do you uninstall a package?
npm Junior -
Where can you find modules that the npm installed locally after you executed the npm install command?
npm Junior -
What information is stored about every dependency in the npm file package.json?
npm Junior -
What metadata does the npm file package.json contain?
npm Junior -
Using npm, how do you install project dependencies?
npm Junior