You are using an unsupported browser. Please update your browser to the latest version on or before July 31, 2020.
close
Home > Project Editor > Adding NPM Packages
Adding NPM Packages
print icon

NPM is the package manager for javascript, and it's the world's largest software registry.

 

To add a package or module from NPM, your project must have a package.json file.  By default the following Glitch starter templates include a package.json:

 

~glitch-hello-node

~glitch-hello-react

~glitch-hello-eleventy

~glitch-hello-sqlite

 

Now, here's how to add an NPM package to your Glitch project:

 

 

 

  1. Open the project in the editor.
  2. In the file view on the left, click on package.json.
  3. Click the + ADD PACKAGE button which can be found at the top of the package.json view.
  4. Use the search box to find the NPM package that you would like to add to your project.
  5. When you find the package that you would like to add, click on it and the project editor will automatically refresh, adding the package selected to your package.json file.

 

Here's how to update a package that has already been installed:

 

 

  1. When there is an update available for a package that is already being used, an alert will appear next to the + ADD PACKAGE button.
  2. Click the button to review the available updates.
  3. Click on the update that you would like to install.

 

 

When adding packages/modules to your Glitch project, remember the following:

  • On Glitch, NPM packages don't count towards the project disk space limit shown in the project editor App Status tray. 
  • There's a separate 1GB limit for NPM packages and currently, the editor does not provide a status meter to show you how much of this space is being used.
  • For this reason, try to avoid installing unnecessary packages to your project.  If you exceed the npm package limit, your project may be automatically suspended by our system.  If this happens, you can use the instructions here to address the issue.

 

 

Got more questions? Check out our Community Forum!
Open 24/7, the forum is where Glitch makers help each other and show off all the rad apps that they have created. It's the friendliest community of coders on the Web!
Feedback
7 out of 10 found this helpful

scroll to top icon