Skip to main content

Command Palette

Search for a command to run...

A Little About NPM

Updated
2 min read

What’s NPM

NPM ( Node Package Manager ) is the official package manager for Node.js or in python you can call this it PIP

Its use

  • Installing libraries or packages from outside

  • Manage dependencies ( library required by the project )

  • Provides a registry at npmjs.com

Standar Project

Project Node.js usually have file ‘ package.json ‘ for configuration center

Step by step

  • First you can open terminal or git bash and choose your location to study or create a new folder, for example i want to create folder for project in future

  • Write 'npm init -y' to initialize npm if you have downloaded node.js otherwise you can read my other article about installing node.js, ‘npm init -y‘ for simple initialize and ‘npm init‘ for initialization and full configuration package.

  • config your npm like this

    ls for check the content into folder

    add “type“ : “module“, after “main“, and don’t forget comma, and remove content in script and write “start“: “node index.js“ like this.

  • create file input.js and follow me

  • create more file index.js

  • you can try the code by writing npm start

    This is an error, if you get an error like me, you can open a terminal and run the code there, this error is caused by an error in the terminal MINGW64

END !!

Thank you for your attention, wait for my other content on my bolg,

Seee you next time.

More from this blog

The Digital Alchemist's Log

21 posts