marcysutton / js-a11y-workshop

Frontend Masters Workshop: Accessibility in JavaScript Applications
https://frontendmasters.com/courses/javascript-accessibility/
MIT License
229 stars 95 forks source link

Error when installing packages initially #4

Closed Vannsl closed 3 years ago

Vannsl commented 3 years ago

Hello!

I cloned this repo a couple of minutes ago.

My node version is v.14.40 and npm version 6.14.8

For npm i I get this error log:

$ npm i

> fsevents@1.2.9 install /Users/vannsl/projects/frontend-masters/js-a11y-workshop/node_modules/fsevents
> node install

node-pre-gyp WARN Using request for node-pre-gyp https download 
node-pre-gyp WARN Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.2.9/fse-v1.2.9-node-v83-darwin-x64.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for fsevents@1.2.9 and node@14.4.0 (node-v83 ABI, unknown) (falling back to source compile with node-gyp) 
  SOLINK_MODULE(target) Release/.node
  CXX(target) Release/obj.target/fse/fsevents.o
In file included from ../fsevents.cc:6:
In file included from ../../nan/nan.h:2884:
../../nan/nan_typedarray_contents.h:34:43: warning: 'GetContents' is deprecated: Use GetBackingStore. See
      http://crbug.com/v8/9908. [-Wdeprecated-declarations]
      data   = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;
                                          ^
/Users/vannsl/Library/Caches/node-gyp/14.4.0/include/node/v8.h:5202:3: note: 'GetContents' has been explicitly marked
      deprecated here
  V8_DEPRECATE_SOON("Use GetBackingStore. See http://crbug.com/v8/9908.")
  ^
/Users/vannsl/Library/Caches/node-gyp/14.4.0/include/node/v8config.h:402:39: note: expanded from macro 'V8_DEPRECATE_SOON'
# define V8_DEPRECATE_SOON(message) [[deprecated(message)]]
                                      ^
1 warning generated.
  SOLINK_MODULE(target) Release/fse.node
  COPY /Users/vannsl/projects/frontend-masters/js-a11y-workshop/node_modules/fsevents/lib/binding/Release/node-v83-darwin-x64/fse.node
  TOUCH Release/obj.target/action_after_build.stamp

> sharp@0.22.1 install /Users/vannsl/projects/frontend-masters/js-a11y-workshop/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.7.4/libvips-8.7.4-darwin-x64.tar.gz
prebuild-install WARN install No prebuilt binaries found (target=14.4.0 runtime=node arch=x64 libc= platform=darwin)
  TOUCH Release/obj.target/libvips-cpp.stamp
  CXX(target) Release/obj.target/sharp/src/common.o
  CXX(target) Release/obj.target/sharp/src/metadata.o
  CXX(target) Release/obj.target/sharp/src/stats.o
../src/stats.cc:130:19: error: no matching member function for call to 'Set'
        channels->Set(i, channelStat);
        ~~~~~~~~~~^~~
/Users/vannsl/Library/Caches/node-gyp/14.4.0/include/node/v8.h:3639:37: note: candidate function not viable: requires 3
      arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/vannsl/Library/Caches/node-gyp/14.4.0/include/node/v8.h:3642:37: note: candidate function not viable: requires 3
      arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
1 error generated.
make: *** [Release/obj.target/sharp/src/stats.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:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Darwin 19.6.0
gyp ERR! command "/usr/local/Cellar/node/14.4.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/vannsl/projects/frontend-masters/js-a11y-workshop/node_modules/sharp
gyp ERR! node -v v14.4.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp@0.22.1 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
npm ERR! Exit status 1

Is that a known issue?

marcysutton commented 3 years ago

Hi @Vannsl, thanks for the issue. I did a fresh install with Node 14.14.0 and hit the same error. Here's what I did to fix it:

rm -rf node_modules && rm package-lock.json
npm install

Not sure why that works in this case with a fresh install, but it did. Gatsby and Sharp sometimes need to be coerced into working.

If it still doesn't work after trying those commands, let me know and we can help debug.

Vannsl commented 3 years ago

Hi @marcysutton, I just wanted to let you know that I don't have access to the same laptop until tomorrow again. I'll check and tell you if it has worked. Thanks already.

Vannsl commented 3 years ago

Works like a charm!