error: no template named ‘remove_cv_t’ in namespace ‘std’; did you mean ‘remove_cv’?

Update: Since node-sass version 6.0.1, Node 16 is supported. Updating node-sass to a version higher than 6.0.1 solves this issue.

What you’re seeing is an error during compilation of node-sass. That’s a package processing your Sass/SCSS styles, which is written in C++ and only re-packaged as a JavaScript library. The fact it’s written in C++ means it needs to be compiled on your device during installation (this is internally done by a tool called node-gyp, which you can spot in your error output, too).

The problem is node-sass doesn’t support Node 16 as of writing this answer, see tracking issue: There’s no estimate on when it’s gonna support it (and that’s fair, as it’s a volunteer-driven project). Even if you manage to install node-sass on Node 16, I’d advice against it, as the behavior might be undefined.

The correct solution is to downgrade your Node installation to a supported version (I can see both 14 and 15 tested in their CI). If you git cloned a project and it won’t install on your machine, but works for your colleagues or on the production server, it’s likely the project has a different version of Node in mind too, and isn’t tested on Node 16, so I’d advice against developing it on Node 16 anyway. If the project worked for you just a few days ago, but it doesn’t work now, it’s very likely you recently upgraded your system setup (e.g. Homebrew), which upgraded you to Node 16 (this is what happened to me and how I found this question).

You should check with the authors of the project what’s the production server version of Node it runs on and install that version locally, too. As a best practice, in the future, keep the production version and your local version of Node (and yarn or npm) in sync. For managing multiple Node versions, you can use this tool

Leave a Comment