NPM Updates on Glitch! (and some tips on how to get your project out of an install loop.)

Hello!

We know that folks have been asking us to provide newer versions of Node for use with Glitch. Today, we have some exciting news to share with you! You can now use Node 14 on Glitch!

This update does mean that we had to make a few changes that you should be aware of…

Here’s the rundown:

  • We have updated our containers to include Node 14!
  • If you have a project that uses Node 14, packages will be installed via npm (instead of pnpm).
  • If you have a project that uses Node 14 and it is currently getting stuck in an install loop, open the project terminal and run the command, enable-npm.
  • If you have a project that uses a version of Node that is Node 12 or older, packages will still be installed via pnpm, unless you have specifically opted into using npm in the past. Please continue to use this method of installation for projects that use an older version of Node (Node 12, 10, Node 8, etc).

And here’s a little more info for those of you that are saying, “wait, wat?!”
We acknowledge that previously, the solution to most install issues on Glitch was to run the command, enable-pnpm. The reason was that using this method resulted in a faster and more efficient installation of packages. With this update, Node 14 always uses npm. Rest assured that neither pnpm’s nor npm’s node_modules folders count against your disk usage limit!

If you have any questions about this, you can post them here or send us a support request.

Edit 12/21/2020: Hi, Jenn here! I’ve updated this post to reflect some changes we made as we rolled back a bit due to users hitting issues, as opposed to making an entirely new thread. What is in this post is the latest information.

17 Likes

@tasha, I would love it if you guys announced this on the main website too, most Glitch users don’t view the forum that often and since this is quite important it could get missed by many.

10 Likes

And Twitter!

8 Likes

My boosted app has been down for over 24 hours (bloomx-currency-bot) … not sure if this post has anything to do with it. Main error in my logs:

internal/modules/cjs/loader.js:638
Error: Cannot find module ‘sqlite3’

Could someone help?

1 Like

So that’s why pnpm wasn’t working at all. Can I still install pnpm manually tho?

npm causes the memory usage to go way high, and that might suspend a project.

1 Like

The project will not be suspended. If you need some assistance installing packages, contact Glitch at support@glitch.com.

5 Likes

ah I see, but the problem is npm installation is slower, and I really liked pnpm because it installs things faster, so is there any possible way to manually enable pnpm on node 12 and above?

2 Likes

Yeah, i have projects for it, i’ve installed sqlite3 there, but if i change my code they’re re-installing. Imagine installing sqlite3 is taking so much time.

EDIT: i’m using watch.json, to make my project stayin if i change my main files. but if i run refresh in terminal, they’re installing :frowning_face:

2 Likes

same problem here, sqlite3 with npm is very slow, and it uses a lot of memory

1 Like

Update: I got a somewhat faster install by adding this preinstall script to package.json:

"scripts": {
   "preinstall": "npm set progress=false && npm set audit false && npm config set fund false",
   "test": "node index.js",
   "start": "node server.js"
}
3 Likes

Hey folks, I’m bumping this thread because I’ve updated the original post to reflect the latest on these changes. Users have experience slow start/build times so we rolled back some of the changes - basically, we only require Node 14 to use npm, not also Node 12.

I’ve also updated our help center doc - https://glitch.happyfox.com/kb/article/59-can-i-change-the-version-of-node-js-my-project-uses/. We appreciate your patience as we work to get your containers up to date with Node!

If you experience issues with your projects that you feel may be a consequence of these changes, please send the name of the project and what error you see to support@glitch.com

10 Likes

Vice versa of course

8 Likes