Trouble setting up a working JS environment for the course
See original GitHub issueFirst of all thanks for sharing this lovely course.
I was going to play around with the course today but I am having trouble setting up the JS requirements on my Mac (node 10, node 12, node 14) and an Ubuntu (node 12) docker image, I am a JS novice so that could be the problem.
I went down a rabbit hole trying to get sharp installed which led me to try and bump sharp up from sharp@0.21.3
based on https://github.com/gatsbyjs/gatsby/issues/13781
Next I played npm whack-a-mole with trying making sure all dependencies’ sharp version gets bumped which led to other dependencies needing to be changed.
Is there a way to resolve all these dependencies in the JS world? Python packaging seems like heaven compared to what I had to go through.
I have managed to create a working Dockerfile with all the updated packages where I can run gatsby in dev mode and run the python tests - I will create a PR to merge these.
— BELOW is my debugging process as a JS novice —
On both my Mac and the Ubuntu docker image following:
npm install -g gatsby-cli # Install Gatsby globally
npm install # Install dependencies
During npm install
installing sharp@0.21.3
fails with an error like this:
> sharp@0.21.3 install /host/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.0/libvips-8.7.0-linux-x64.tar.gz
prebuild-install WARN install No prebuilt binaries found (target=12.16.3 runtime=node arch=x64 libc= platform=linux)
make: Entering directory '/host/node_modules/sharp/build'
TOUCH Release/obj.target/libvips-cpp.stamp
CXX(target) Release/obj.target/sharp/src/common.o
In file included from ../src/common.cc:27:0:
../src/common.h:78:20: error: 'Handle' is not a member of 'v8'
bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
^~~~~~
../src/common.h:78:37: error: expected primary-expression before '>' token
bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
.
.
.
Then I used to hunt down dependencies using sharp and what version are coming through:
npm ls | grep -C 10 --color sharp
Then using npm-remote-ls looked for what the updated sharp version would be for example with gatsby-plugin-manifest:
npm-remote-ls gatsby-plugin-manifest@2.0.29 | grep sharp
Tried to harmonise the version bumps to use one version of sharp as multiple sharp versions seem to potentially cause challenges.
Finally I have tried to resolve all conflicts from the previous bumps. As a complete JS Novice I am not sure if my approach is sensible I will make a PR where you can review
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (5 by maintainers)
Top GitHub Comments
Sure I will pull the config.env into the makefile. It is not a convention just a pattern I like to use. With just one env var it makes sense to pull it in.
Possibly related to
node-gyp
package. See https://github.com/nodejs/node-gyp/issues/1779.