DEV Community

Discussion on: A Beginner's Guide on Creating a Portfolio Website with Github and Gatsby

 
jvmvl profile image
jvmvl • Edited

Tested using git bash

$ npm run build

portfolio-website-gatsby@1.0.0 build **\jvmvl.github.io\gatsby
npm run clean && gatsby build && cp -a public/
../

portfolio-website-gatsby@1.0.0 clean **\jvmvl.github.io\gatsby
del-cli -f "../!(gatsby)
" && rm -rf public && rm -rf .cache

success open and validate gatsby-configs — 0.005 s
success load plugins — 0.169 s
error Plugin gatsby-transformer-sharp returned an error

Error: Cannot find module '../build/Release/sharp.node'

  • loader.js:581 Function.Module._resolveFilename
    internal/modules/cjs/loader.js:581:15

  • loader.js:507 Function.Module._load
    internal/modules/cjs/loader.js:507:25

  • loader.js:637 Module.require
    internal/modules/cjs/loader.js:637:17

  • v8-compile-cache.js:159 require
    [gatsby]/[v8-compile-cache]/v8-compile-cache.js:159:20

  • constructor.js:10 Object.
    [gatsby]/[sharp]/lib/constructor.js:10:15

  • v8-compile-cache.js:178 Module._compile
    [gatsby]/[v8-compile-cache]/v8-compile-cache.js:178:30

  • loader.js:700 Object.Module._extensions..js
    internal/modules/cjs/loader.js:700:10

  • loader.js:599 Module.load
    internal/modules/cjs/loader.js:599:32

  • loader.js:538 tryModuleLoad
    internal/modules/cjs/loader.js:538:12

  • loader.js:530 Function.Module._load
    internal/modules/cjs/loader.js:530:3

  • loader.js:637 Module.require
    internal/modules/cjs/loader.js:637:17

  • v8-compile-cache.js:159 require
    [gatsby]/[v8-compile-cache]/v8-compile-cache.js:159:20

  • index.js:3 Object.
    [gatsby]/[sharp]/lib/index.js:3:15

  • v8-compile-cache.js:178 Module._compile
    [gatsby]/[v8-compile-cache]/v8-compile-cache.js:178:30

  • loader.js:700 Object.Module._extensions..js
    internal/modules/cjs/loader.js:700:10

  • loader.js:599 Module.load
    internal/modules/cjs/loader.js:599:32

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! portfolio-website-gatsby@1.0.0 build: npm run clean && gatsby build && cp -a public/* ../
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the portfolio-website-gatsby@1.0.0 build 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! ***\Roaming\npm-cache_logs\2019-09-21T10_21_33_887Z-debug.log

Thread Thread
 
geocine profile image
Aivan Monceller

You can try, Deleting node_modules, .cache, public then do

npm cache clean --force
npm install

If its still not working on your machine for some reason, then install sharp manually

npm install sharp --unsafe-perm