Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reinstalling packages to the last version gives an file not found error #17545

Closed
cassmtnr opened this issue Sep 11, 2019 · 7 comments
Closed
Labels
type: question or discussion Issue discussing or asking a question about Gatsby

Comments

@cassmtnr
Copy link

Description

Describe the issue that you're seeing.

I just run the npm install command and got an error output on my terminal, it was working perfectly last week.

Here is my package.json dependencies:

https://github.com/cassianomon/cassianomon.github.io/blob/develop/package.json

"dependencies": {
    "browserslist": "^4.7.0",
    "@emotion/core": "^10.0.17",
    "@emotion/styled": "^10.0.17",
    "gatsby": "^2.15.14",
    "gatsby-cli": "^2.7.47",
    "gatsby-image": "^2.2.18",
    "gatsby-plugin-google-analytics": "^2.1.16",
    "gatsby-plugin-manifest": "^2.2.16",
    "gatsby-plugin-offline": "^3.0.6",
    "gatsby-plugin-react-helmet": "^3.1.7",
    "gatsby-plugin-sass": "^2.1.14",
    "gatsby-plugin-sharp": "^2.2.21",
    "gatsby-source-filesystem": "^2.1.22",
    "gatsby-transformer-sharp": "2.1.19",
    "node-sass": "^4.12.0",
    "prop-types": "^15.7.2",
    "react": "^16.9.0",
    "react-dom": "^16.9.0",
    "react-helmet": "^5.2.1"
  },
  "devDependencies": {
    "babel-eslint": "10.0.3",
    "cpx": "^1.5.0",
    "eslint-plugin-prettier": "3.1.0",
    "gatsby-plugin-root-import": "^2.0.5",
    "gh-pages": "^2.1.1",
    "prettier": "^1.18.2",
    "prettierrc": "0.0.0-5"
  },

Steps to reproduce

Clear steps describing how to reproduce the issue. Please please please link to a demo project if possible, this makes your issue much easier to diagnose (seriously).

Expected result

What should happen?

To start development server

Actual result

What happened.

Terminal output the error below:

> fsevents@1.2.9 install /Users/cassiano/Dropbox/Dev/gh-page/node_modules/fsevents
> node install

node-pre-gyp WARN Using request for node-pre-gyp https download 
[fsevents] Success: "/Users/cassiano/Dropbox/Dev/gh-page/node_modules/fsevents/lib/binding/Release/node-v72-darwin-
x64/fse.node" is installed via remote

> sharp@0.22.1 install /Users/cassiano/Dropbox/Dev/gh-page/node_modules/gatsby-transformer-sharp/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy
)

info sharp Using cached /Users/cassiano/.npm/_libvips/libvips-8.7.4-darwin-x64.tar.gz

> sharp@0.23.0 install /Users/cassiano/Dropbox/Dev/gh-page/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy
)

info sharp Using cached /Users/cassiano/.npm/_libvips/libvips-8.8.1-darwin-x64.tar.gz
ERR! sharp Please delete /Users/cassiano/.npm/_libvips/libvips-8.8.1-darwin-x64.tar.gz as it is not a valid tarball
ERR! sharp zlib: unexpected end of file
info sharp Attempting to build from source via node-gyp but this may fail due to the above error
info sharp Please see https://sharp.pixelplumbing.com/page/install for required dependencies
  TOUCH Release/obj.target/libvips-cpp.stamp
  CXX(target) Release/obj.target/sharp/src/common.o
../src/common.cc:25:10: fatal error: 'vips/vips8' file not found
#include <vips/vips8>
         ^~~~~~~~~~~~
1 error generated.
make: *** [Release/obj.target/sharp/src/common.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:196:2
3)
gyp ERR! stack     at ChildProcess.emit (events.js:200:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 18.7.0
gyp ERR! command "/usr/local/Cellar/node/12.3.1/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bi
n/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/cassiano/Dropbox/Dev/gh-page/node_modules/sharp
gyp ERR! node -v v12.3.1
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok 
npm WARN eslint-config-react-app@4.0.1 requires a peer of eslint-plugin-flowtype@2.x but none is installed. You mus
t install peer dependencies yourself.
npm WARN tsutils@3.17.1 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >=
 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must instal
l peer dependencies yourself.
npm WARN ts-pnp@1.1.4 requires a peer of typescript@* but none is installed. You must install peer dependencies you
rself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp@0.23.0 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp re
build && node install/dll-copy)`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the sharp@0.23.0 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!     /Users/cassiano/.npm/_logs/2019-09-11T03_21_52_105Z-debug.log

Environment

Run gatsby info --clipboard in your project directory and paste the output here.

  System:
    OS: macOS 10.14.6
    CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 12.3.1 - /usr/local/bin/node
    Yarn: 1.16.0 - /usr/local/bin/yarn
    npm: 6.11.3 - /usr/local/bin/npm
  Languages:
    Python: 2.7.15 - /usr/local/bin/python
  Browsers:
    Chrome: 77.0.3865.75
    Firefox: 67.0.4
    Safari: 12.1.2
  npmPackages:
    gatsby: ^2.15.14 => 2.15.14 
    gatsby-cli: ^2.7.47 => 2.7.47 
    gatsby-image: ^2.2.18 => 2.2.18 
    gatsby-plugin-google-analytics: ^2.1.16 => 2.1.16 
    gatsby-plugin-offline: ^3.0.6 => 3.0.6 
    gatsby-plugin-react-helmet: ^3.1.7 => 3.1.7 
    gatsby-plugin-root-import: ^2.0.5 => 2.0.5 
    gatsby-plugin-sass: ^2.1.14 => 2.1.14 
    gatsby-source-filesystem: ^2.1.22 => 2.1.22 
    gatsby-transformer-sharp: 2.1.19 => 2.1.19 
  npmGlobalPackages:
    gatsby-cli: 2.6.2
@cassmtnr cassmtnr changed the title Reinstalling packages fires a error of sharp Reinstalling packages to the last version gives an file not found error Sep 11, 2019
@LekoArts LekoArts added the type: question or discussion Issue discussing or asking a question about Gatsby label Sep 11, 2019
@LekoArts
Copy link
Contributor

Your issue is not directly related to Gatsby but your installation of the sharp dependencies. Please try running npm rebuild, deleting your node_modules folder and running npm install again.

@cassmtnr
Copy link
Author

Your issue is not directly related to Gatsby but your installation of the sharp dependencies. Please try running npm rebuild, deleting your node_modules folder and running npm install again.

Well, it comes along with Gatsby gatsby new MyAwesomeProject, so I think it's related to Gatsby.

Done what you told me and now I have this output and the project won't start:

➜  gh-page git:(develop) ✗ npm start           

> cassianomon.github.io@0.1.0 start /Users/cassiano/Dropbox/Dev/gh-page
> npm run develop


> cassianomon.github.io@0.1.0 develop /Users/cassiano/Dropbox/Dev/gh-page
> gatsby develop

success open and validate gatsby-configs - 0.047 s
⠋ load plugins

(sharp:31406): GLib-GObject-WARNING **: 09:18:26.388: cannot register existing type 'VipsObject'

(sharp:31406): GLib-CRITICAL **: 09:18:26.388: g_once_init_leave: assertion 'result != 0' failed

(sharp:31406): GLib-GObject-CRITICAL **: 09:18:26.388: g_type_register_static: assertion 'parent_type > 0' failed

(sharp:31406): GLib-CRITICAL **: 09:18:26.389: g_once_init_leave: assertion 'result != 0' failed

@LekoArts
Copy link
Contributor

When running gatsby new you're cloning the default starter which contains among other things also two sharp plugins. As people in this issue #16957 you likely have multiple, conflicting versions of libvips installed (also mentioned here: lovell/sharp#1725)

@cassmtnr
Copy link
Author

cassmtnr commented Sep 12, 2019

Fixed with gatsby-plugin-sharp => "2.2.14", shouldn't the gatsby new run with this version as default until it get fixed?

If so, I would love to make a pull request for it 😄

@LekoArts
Copy link
Contributor

I know, no one wants to hear the infamous "it works on my machine", but as we mentioned in the linked issue the problem doesn't exist because of the sharp plugin, but outdated libvips version – that's also the reason why gatsby new works for me just fine. Therefore we shouldn't change the version in the default starter.

@LekoArts
Copy link
Contributor

We're marking this issue as answered and closing it for now but please feel free to reopen this and comment if you would like to continue this discussion. We hope we managed to help and thank you for using Gatsby!

@MartinMalinda
Copy link

MartinMalinda commented Nov 4, 2019

I just experienced this too, on my first gatsby new, #17545 (comment) indeed fixes it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question or discussion Issue discussing or asking a question about Gatsby
Projects
None yet
Development

No branches or pull requests

3 participants