Docker Node Alpine Image Build Fails on node-gyp

Also stated in my post update, here’s the Dockerfile I used to get things working: FROM node:8.12-alpine RUN apk add g++ make py3-pip EXPOSE 8080 RUN mkdir /app WORKDIR /app COPY . /app RUN npm install CMD [“npm”, “start”] If your requirements demand your image minimize space, consider installing necessary packages with RUN apk add … Read more

npm package.json OS specific dependency

There’s a possible good way of doing this, depending on your setup. npm package.json supports an os key, and also optionalDependencies os can be used to specify which OS a module can be installed on. optionalDependencies are module dependencies that if they cannot be installed, npm skips them and continues installing. In this way you … Read more

What is node-gyp?

node-gyp is a tool which compiles Node.js Addons. Node.js Addons are native Node.js Modules, written in C or C++, which therefore need to be compiled on your machine. After they are compiled with tools like node-gyp, their functionality can be accessed via require(), just as any other Node.js Module. If you do what you suggested … Read more

Node.js: Python not found exception due to node-sass and node-gyp

so this happened to me on windows recently. I fix it by following the following steps using a PowerShell with admin privileges: delete node_modulesfolder running npm install –global windows-build-tools with administrative privilege. (in my case need restart – and restart without ask!!!) reinstalling node modules or node-sass with npm install

`npm install` fails on node-gyp rebuild with `gyp: No Xcode or CLT version detected!`

Even though you have them installed (my case), but by upgrading to Catalina (10.15.*) you can get this error (my case 🙂 ). Therefore, simply installing wouldn’t help as you will get an error that they are already installed. Therefore you need to hopefully just (I) reset the tool or in worse case (II) uninstall … Read more