Sharp: yarn: permission denied, open .../npm-sharp-0.16.1/include/glibconfig.h

Created on 18 Oct 2016  路  8Comments  路  Source: lovell/sharp

I tried to use use yarn with Relax CMS. Along the way I updated sharp to 0.16.1 as it provides the macOS binary I need. But got EACCES: permission denied, open '/Users/sdubois/.yarn-cache/npm-sharp-0.16.1/include/glibconfig.h'. /cc @bruno12mota

Code is here.

Arguments: 
  /Users/sdubois/.nvm/versions/node/v6.6.0/bin/node /Users/sdubois/.nvm/versions/node/v6.6.0/bin/yarn

PATH: 
  /Users/sdubois/.nvm/versions/node/v6.6.0/bin:./node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

Yarn version: 
  0.16.0

Node version: 
  6.6.0

Platform: 
  darwin x64

npm manifest: 
  {
    "name": "relax",
    "version": "0.0.0",
    "description": "New generation CMS on top of React and Node.js",
    "license": "GPL-3.0",
    "repository": {
      "type": "git",
      "url": "https://github.com/relax/relax.git"
    },
    "scripts": {
      "build": "cross-env NODE_ENV=production webpack --config ./webpack/prod/webpack.config.js",
      "start": "cross-env NODE_ENV=production node build/app",
      "startDev": "cross-env NODE_ENV=development node build/app",
      "dev": "parallelshell \"yarn webpackServer\" \"yarn watchServer\"",
      "watchServer": "nodemon -e js,jsx,json -w app.js -w lib -i lib/client -x \"webpack --config ./webpack/dev/webpack.node.config.js && yarn startDev\"",
      "webpackServer": "webpack-dev-server --config ./webpack/dev/webpack.browser.config.js --inline --hot --quiet --display-error-details",
      "lint": "eslint lib/** --quiet",
      "test": "cross-env NODE_ENV=test mocha-webpack --colors --webpack-config ./webpack/test/webpack.config \"lib/**/__tests__/*.js\""
    },
    "dependencies": {
      "babel-polyfill": "^6.3.14",
      "bluebird": "^3.4.0",
      "body-parser": "^1.13.3",
      "classnames": "^2.1.3",
      "color-thief": "git+https://github.com/relax/color-thief.git",
      "colr": "^1.2.2",
      "connect-mongo": "^0.8.2",
      "del": "^2.2.0",
      "dropzone": "git+https://github.com/relax/dropzone.git",
      "express": "^4.13.3",
      "express-graphql": "^0.4.0",
      "express-session": "^1.11.3",
      "file-size": "^1.0.0",
      "graphql": "^0.4.7",
      "graphql-type-json": "^0.1.2",
      "history": "1.17.0",
      "hoist-non-react-statics": "^1.0.3",
      "invariant": "^2.2.0",
      "js-md5": "^0.3.0",
      "kerberos": "^0.0.21",
      "keymaster": "git+https://github.com/relax/keymaster.git",
      "lodash.clone": "^3.0.3",
      "lodash.clonedeep": "^3.0.2",
      "lodash.debounce": "^3.1.1",
      "lodash.filter": "^3.1.1",
      "lodash.find": "^3.2.1",
      "lodash.findindex": "https://registry.npmjs.org/lodash.findindex/-/lodash.findindex-4.6.0.tgz",
      "lodash.foreach": "^3.0.3",
      "lodash.get": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz",
      "lodash.intersection": "^4.2.0",
      "lodash.merge": "^3.3.2",
      "lodash.omit": "^3.1.0",
      "lodash.sortby": "^3.1.5",
      "lodash.union": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.6.0.tgz",
      "medium-editor": "git+https://github.com/relax/medium-editor.git",
      "mkdirp": "^0.5.1",
      "moment": "^2.10.6",
      "mongoose": "^4.1.12",
      "morgan": "^1.6.1",
      "multer": "^1.0.6",
      "nodemailer": "^1.5.0",
      "passport": "^0.3.0",
      "passport-local": "^1.0.0",
      "passport-local-mongoose": "^3.1.0",
      "query-string": "^3.0.0",
      "rc": "^1.1.1",
      "react": "^0.14.0",
      "react-colorpicker": "git+https://github.com/relax/react-colorpicker.git#relay",
      "react-counter": "git+https://github.com/relax/react-counter.git#relay",
      "react-dom": "^0.14.0",
      "react-dropzone": "^3.2.2",
      "react-gemini-scrollbar": "^2.0.1",
      "react-google-maps": "^4.6.0",
      "react-redux": "^4.4.0",
      "react-router": "^1.0.2",
      "redux": "^3.3.1",
      "redux-combine-actions": "^0.1.2",
      "redux-logger": "^2.0.4",
      "redux-router": "1.0.0-beta5",
      "redux-thunk": "^1.0.0",
      "relate-js": "^0.6.12",
      "relax-fragments": "0.1.1",
      "relax-jss": "0.2.0",
      "semver": "^5.0.3",
      "serialize-javascript": "^1.1.2",
      "shallowequal": "^0.2.2",
      "sharp": "^0.16.1",
      "slug": "^0.9.1",
      "soundmanager2": "git+https://github.com/relax/SoundManager2.git",
      "superagent": "^1.6.1",
      "touch": "^1.0.0",
      "relax-velocity-animate": "1.0.0",
      "warning": "^2.1.0",
      "winston": "^2.1.0"
    },
    "devDependencies": {
      "autoprefixer": "^6.3.6",
      "babel-core": "6.4.5",
      "babel-eslint": "6.0.2",
      "babel-loader": "6.2.2",
      "babel-plugin-react-transform": "2.0.0",
      "babel-plugin-transform-decorators-legacy": "1.3.4",
      "babel-plugin-transform-react-constant-elements": "6.9.1",
      "babel-plugin-transform-react-inline-elements": "6.8.0",
      "babel-preset-es2015": "6.3.13",
      "babel-preset-react": "6.3.13",
      "babel-preset-stage-0": "6.3.13",
      "chai": "^3.5.0",
      "copy-webpack-plugin": "^2.1.3",
      "cross-env": "^1.0.7",
      "css-loader": "^0.23.1",
      "eslint": "^2.8.0",
      "eslint-config-airbnb": "^7.0.0",
      "eslint-plugin-jsx-a11y": "^0.6.2",
      "eslint-plugin-react": "^4.2.2",
      "extract-text-webpack-plugin": "^1.0.1",
      "file-loader": "^0.8.4",
      "json-loader": "^0.5.3",
      "less": "^2.6.0",
      "less-loader": "^2.2.2",
      "mocha": "^2.5.3",
      "mocha-webpack": "^0.3.1",
      "nodemon": "^1.8.1",
      "null-loader": "^0.1.1",
      "parallelshell": "^2.0.0",
      "postcss-loader": "^0.9.1",
      "react-transform-catch-errors": "^1.0.2",
      "react-transform-hmr": "^1.0.2",
      "redbox-react": "^1.2.0",
      "source-map-support": "^0.4.0",
      "style-loader": "^0.13.0",
      "unicode": "^0.6.1",
      "url-loader": "^0.5.6",
      "webpack": "^1.12.6",
      "webpack-dev-server": "^1.12.1",
      "webpack-hot-middleware": "^2.5.0",
      "webpack-node-externals": "^1.2.0"
    }
  }

yarn manifest: 
  No manifest

bower manifest: 
  No manifest

Lockfile: 
  No lockfile

Trace: 
  Error: /Users/sdubois/Documents/belong/relax/node_modules/sharp: EACCES: permission denied, open '/Users/sdubois/.yarn-cache/npm-sharp-0.16.1/include/glibconfig.h'
      at Error (native)

blocked-upstream-dependency enhancement

Most helpful comment

I've manually modified the OS X libvips v8.3.3 tarball so the glibconfig.h file is no longer read-only file.

Ignoring the likelihood of some temporary CDN caching, it should "just work" with yarn now.

All 8 comments

Hello, did you see https://github.com/yarnpkg/yarn/issues/872 ? It looks like yarn doesn't like files in its cache that do not have write permissions.

To deal with the effects of this, sharp v0.17.0 will ensure all files in the OS X tarball have write permissions - see https://github.com/lovell/package-libvips-darwin/commit/1eb803ee468b8090e7568aa6896dcb910dcbcef7#diff-4b4b60f5c2fffe5b6a2d75bb86782695

To workaround it for now, you should be able to grant yarn the access it needs via something like:

chmod +w ~/.yarn-cache/npm-sharp-0.16.1/include/glibconfig.h

Thanks, I hadn't seen. Tried chmod but still yields Cannot find module './build/Release/sharp.node' afterwards. Didn't investigate further and will wait for sharp 0.17 or a yarn fix. Thanks 馃槉

May be worth to release 0.16.2? I already prepared my project scripts to use yarn, but sharp blocks things. It will be nice if we should not wait until all 0.17 issues solved.

I've manually modified the OS X libvips v8.3.3 tarball so the glibconfig.h file is no longer read-only file.

Ignoring the likelihood of some temporary CDN caching, it should "just work" with yarn now.

I confirm, now works. Thanks!

I'm on Ubuntu x86, running Node v7.4.0, and I am getting this error

module.js:472
    throw err;
    ^

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

i tried chanring the permissions fir src/*.h under yarn's cache, but it didn't work.
any ideas how to solve this?

not sure how to recompile after that change

@eksperimental The problem you describe is unrelated to yarn. If you're using 32-bit (x86) Linux, please check the installation instructions for libvips at http://sharp.dimens.io/en/stable/install/#linux then post a new issue if you're still having problems.

Was this page helpful?
0 / 5 - 0 ratings