当我添加Android时,更新NodeJs->错误

时间:2019-06-26 05:12:12

标签: android node.js angular cordova ionic-framework

你好 我成为公司的新工作区。这样就安装了一个新的nodejs版本。 12.4.0 当我克隆我的Ionic项目并添加Android平台时,我总是会遇到此错误。

[cordova-res] Something went wrong installing the “sharp” module
[cordova-res]
[cordova-res] The module ‘\?\USERNAME\AppData\Roaming\npm\node_modules\cordova-res\node_modules\sharp\build\Release\sharp.node’
[cordova-res] was compiled against a different Node.js version using
[cordova-res] NODE_MODULE_VERSION 57. This version of Node.js requires
[cordova-res] NODE_MODULE_VERSION 72. Please try re-compiling or re-installing
[cordova-res] the module (for instance, using npm rebuild or npm install).
[cordova-res]
[cordova-res] - Ensure the version of Node.js used at install time matches that used at runtime
[cordova-res] - Consult the installation documentation at https://sharp.pixelplumbing.com/en/stable/install/
[cordova-res] - Search for this error at https://github.com/lovell/sharp/issues
[cordova-res]

有人可以帮助我吗?谢谢

1 个答案:

答案 0 :(得分:0)

您似乎需要先更新Sharp。

因此键入您的控制台

npm remove sharp 

并且一旦删除

npm install sharp