NPM警告不支持gatsby插件的Unopported引擎



运行命令npm install gatsby-plugin-google-tagmanager时出现以下错误

我试着通过运行npm update -g来更新npm版本,但当我检查它时,它仍然是";6.14.6";。

任何帮助都将不胜感激,谢谢。

npm WARN notsup Unsupported engine for gatsby-plugin-google-tagmanager@3.4.0: 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: gatsby-plugin-google-tagmanager@3.4.0
npm WARN gatsby-plugin-google-tagmanager@3.4.0 requires a peer of gatsby@^3.0.0-next.0 but none is installed. You must install peer dependencies yourself.
npm WARN gatsby-plugin-google-tagmanager@3.4.0 requires a peer of react@^16.9.0 || ^17.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN gatsby-plugin-google-tagmanager@3.4.0 requires a peer of react-dom@^16.9.0 || ^17.0.0 but none is installed. You must install peer dependencies yourself.
+ gatsby-plugin-google-tagmanager@3.4.0
updated 1 package and audited 3 packages in 0.68s
found 0 vulnerabilities

需要更新的不是npm,而是Node.js。您运行的是Node.js 10.22.0,但包gatsby-plugin-google-tagmanager@3.4.0需要Node.js 12.13.0或更高版本。

考虑到对Node.js 10.x的支持在几天前(2021年4月30日(结束,这是更新的另一个原因。目前,我建议更新到14.x,这是最新的LTS(长期支持(版本。不过,12.x还可以,并且将支持12个月。(14.x将支持24个月。16.x将支持36个月,但直到10月份才正式发布LTS,因此可能会发生很多在LTS版本中不会发生的变化。(

同样值得注意的是,该软件包实际上已经安装好了。您收到了关于Node.js版本的警告,但没有收到错误。尽管如此,我还是不建议尝试使用它所说的不支持的Node.js版本来运行该包。

最新更新