简体   繁体   中英

I cannot install gatsby-plugin-sharp

   npm i gatsby-plugin-sharp

Trying to install gatsby-plugin-sharp on my Windows7 32bit but ecountered this error

npm ERR!
npm ERR! Failed at the pngquant-bin@5.0.2 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional
logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Qudusayo\AppData\Roaming\npm-cache\_logs\2020-05-23T08_58_04_544Z-debug.log

Try:

npm install --global windows-build-tools

Then, install gatsby-plugin-sharp again:

   npm i gatsby-plugin-sharp

Resources:

On my machine the proposed solution didnot work. I tried many different approaches for the last couple of days. The only one that got the plugin installed is the following (Windows):

  1. Check if the ignore-scripts is not set to false globally:

     npm config set ignore-scripts true
  2. Remove the old sharp folder from node_modules

  3. Re install it as:

     npm install sharp --unsafe-perm
  4. If the above doesnt work try this

    npm rebuild --verbose sharp

Happy coding! You may refer to this link .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM