gatsbyjs / gatsby

The best React-based framework with performance, scalability and security built in.
https://www.gatsbyjs.com
MIT License
55.28k stars 10.31k forks source link

Failed at the sharp@0.17.3 install script. on ubuntu 16.04 #8024

Closed alexfinchme closed 5 years ago

alexfinchme commented 6 years ago

Description

I'm getting the error Failed at the sharp@0.17.3 install script. in the log when running gatsby new siteName https://github.com/haysclark/gatsby-starter-casper

Steps to reproduce

new droplet ubuntu 16.04 on digital ocean apt update apt dist-upgrade -y curl -sL https://deb.nodesource.com/setup_10.x | sudo bash - sudo apt install nodejs npm install --global gatsby-cli gatsby new siteName https://github.com/haysclark/gatsby-starter-casper

Expected result

Site created

Actual result

gyp ERR! build error 
gyp ERR! stack Error: not found: make
gyp ERR! stack     at getNotFoundError (/usr/lib/node_modules/npm/node_modules/which/which.js:13:12)
gyp ERR! stack     at F (/usr/lib/node_modules/npm/node_modules/which/which.js:68:19)
gyp ERR! stack     at E (/usr/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack     at /usr/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack     at /usr/lib/node_modules/npm/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /usr/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:154:21)
gyp ERR! System Linux 4.4.0-131-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /root/paxos/node_modules/sharp
gyp ERR! node -v v10.10.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm WARN gatsby-starter-casper@1.0.7 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp@0.17.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the sharp@0.17.3 install 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!     /root/.npm/_logs/2018-09-10T12_44_21_691Z-debug.log
error Command failed: npm install

Environment

  System:
    OS: Linux 4.4 Ubuntu 16.04.5 LTS (Xenial Xerus)
    CPU: x64 Intel(R) Xeon(R) CPU E5-2650 v4 @ 2.20GHz
    Shell: 4.3.48 - /bin/bash
  Binaries:
    Node: 10.10.0 - /usr/bin/node
    npm: 6.4.1 - /usr/bin/npm
  npmGlobalPackages:
    gatsby-cli: 1.1.58
error xsel: Can't open display: (null)
: Inappropriate ioctl for device

  Error: xsel: Can't open display: (null)
  : Inappropriate ioctl for device

  - envinfo.js:1 Function.e.exports.sync
    [lib]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:7778

  - envinfo.js:1 Object.copySync
    [lib]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:105951

  - envinfo.js:1 Object.t.writeSync.e [as writeSync]
    [lib]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:123499

  - envinfo.js:1 
    [lib]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:124274

  - envinfo.js:1 Promise.all.then.e
    [lib]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:124289

  - util.js:16 tryCatcher
    [lib]/[gatsby-cli]/[bluebird]/js/release/util.js:16:23

  - promise.js:512 Promise._settlePromiseFromHandler
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:512:31

  - promise.js:569 Promise._settlePromise
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:569:18

  - promise.js:614 Promise._settlePromise0
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:614:10

  - promise.js:694 Promise._settlePromises
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:694:18

  - promise.js:638 Promise._fulfill
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:638:18

  - promise_array.js:126 PromiseArray._resolve
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise_array.js:126:19

  - promise_array.js:144 PromiseArray._promiseFulfilled
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise_array.js:144:14

  - promise.js:574 Promise._settlePromise
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:574:26

  - promise.js:614 Promise._settlePromise0
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:614:10

  - promise.js:694 Promise._settlePromises
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:694:18

error UNHANDLED REJECTION

  Error: xsel: Can't open display: (null)
  : Inappropriate ioctl for device

  - envinfo.js:1 Function.e.exports.sync
    [lib]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:7778

  - envinfo.js:1 Object.copySync
    [lib]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:105951

  - envinfo.js:1 Object.t.writeSync.e [as writeSync]
    [lib]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:123499

  - envinfo.js:1 
    [lib]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:124274

  - envinfo.js:1 Promise.all.then.e
    [lib]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:124289

  - util.js:16 tryCatcher
    [lib]/[gatsby-cli]/[bluebird]/js/release/util.js:16:23

  - promise.js:512 Promise._settlePromiseFromHandler
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:512:31

  - promise.js:569 Promise._settlePromise
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:569:18

  - promise.js:614 Promise._settlePromise0
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:614:10

  - promise.js:694 Promise._settlePromises
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:694:18

  - promise.js:638 Promise._fulfill
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:638:18

  - promise_array.js:126 PromiseArray._resolve
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise_array.js:126:19

  - promise_array.js:144 PromiseArray._promiseFulfilled
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise_array.js:144:14

  - promise.js:574 Promise._settlePromise
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:574:26

  - promise.js:614 Promise._settlePromise0
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:614:10

  - promise.js:694 Promise._settlePromises
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:694:18
kakadiadarpan commented 6 years ago

Hi @alexfinchme, could you try installing sharp@0.17.3 first and check if that is successful?

kakadiadarpan commented 6 years ago

Also, by looking at the version of sharp, I assume you are not using yarn as your package manager. The package-lock.json has an older version of sharp compared to yarn.lock in gatsby-starter-casper. We also recommend you to remove the node_modules and lock files and try the installation after that.

alexgmuir commented 6 years ago

The problem was that I needed to install the following to get that particular starter to work.

npm install sharp apt install xsel apt install make apt install g++

stefanprobst commented 6 years ago

Is this issue resolved?

gatsbot[bot] commented 5 years ago

Old issues will be closed after 30 days of inactivity. This issue has been quiet for 20 days and is being marked as stale. Reply here or add the label "not stale" to keep this issue open!

gatsbot[bot] commented 5 years ago

This issue is being closed due to inactivity. Is this a mistake? Please re-open this issue or create a new issue.

VladRDV commented 5 years ago

The problem was that I needed to install the following to get that particular starter to work.

npm install sharp apt install xsel apt install make apt install g++

this helped me to solve problem specified in here with the whole """ ERR! sharp EACCES: permission denied, open '/home/dvg/workspace/test/gatsby-v2-starter-lumen/node_modules/sharp/24782-libvips-8.7.0-linux-x64.tar.gz' """ thing i've checked both 'develop' and 'build' work just fine (leaving this here just in case : Binaries: Node: 10.15.1 - ~/.nvm/versions/node/v10.15.1/bin/node npm: 6.4.1 - ~/.nvm/versions/node/v10.15.1/bin/npm )