Search code examples
node.jsnpmgatsbynpm-installgatsby-plugin

NPM Warning notsup Unsopported engine for gatsby-plugin


I am getting the following error when running the command npm install gatsby-plugin-google-tagmanager

I tried updating the npm version by running npm update -g but when I check it, it's still "6.14.6".

Any help will be appreciated, thanks.

npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":">=12.13.0"} (current: {"node":"10.22.0","npm":"6.14.6"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN [email protected] requires a peer of gatsby@^3.0.0-next.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react@^16.9.0 || ^17.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-dom@^16.9.0 || ^17.0.0 but none is installed. You must install peer dependencies yourself.

+ [email protected]
updated 1 package and audited 3 packages in 0.68s
found 0 vulnerabilities

Solution

  • It's not the npm that needs an update but rather Node.js. You are running Node.js 10.22.0, but the package [email protected] requires Node.js 12.13.0 or higher.

    Given that support for Node.js 10.x ended a few days ago (on April 30 2021), that's another reason to update. At the current time, I'd recommend updating to 14.x which is the most recent LTS (long-term-support) release. 12.x is fine, though, and will be supported for another 12 months. (14.x will be supported for another 24 months. 16.x will be supported for another 36 months, but is not officially an LTS release until October, so lots of changes might happen with it that wouldn't happen in an LTS release.)

    It's also worth noting that the package did in fact get installed. You received a warning about the Node.js version, but not an error. Still, I would not recommend trying to run the package with a version of Node.js that it says it does not support.