It seems that with the latest commit (Update node.js v11.x to v11.1.0 with Yarn v1.12.1), the latest version of node:alpine is broken. When trying to run npm install on our angular project using node:alpine, we are getting the following error (it seems to be with node-sass and gyp):
> [email protected] install /usr/src/app/node_modules/@angular-devkit/build-angular/node_modules/node-sass
> node scripts/install.js
Downloading binary from https://github.com/sass/node-sass/releases/download/v4.9.3/linux_musl-x64-67_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.9.3/linux_musl-x64-67_binding.node":
HTTP error 404 Not Found
Hint: If github.com is not accessible in your location
try setting a proxy via HTTP_PROXY, e.g.
export HTTP_PROXY=http://example.com:1234
or configure npm proxy via
npm config set proxy http://example.com:8080
> [email protected] install /usr/src/app/node_modules/node-sass
> node scripts/install.js
Downloading binary from https://github.com/sass/node-sass/releases/download/v4.9.4/linux_musl-x64-67_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.9.4/linux_musl-x64-67_binding.node":
HTTP error 404 Not Found
Hint: If github.com is not accessible in your location
try setting a proxy via HTTP_PROXY, e.g.
export HTTP_PROXY=http://example.com:1234
or configure npm proxy via
npm config set proxy http://example.com:8080
> [email protected] postinstall /usr/src/app/node_modules/@angular-devkit/build-angular/node_modules/node-sass
> node scripts/build.js
Building: /usr/local/bin/node /usr/src/app/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ '/usr/local/bin/node',
gyp verb cli '/usr/src/app/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library=' ]
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed at getNotFoundError (/usr/src/app/node_modules/which/which.js:13:12)
gyp verb `which` failed at F (/usr/src/app/node_modules/which/which.js:68:19)
gyp verb `which` failed at E (/usr/src/app/node_modules/which/which.js:80:29)
gyp verb `which` failed at /usr/src/app/node_modules/which/which.js:89:16
gyp verb `which` failed at /usr/src/app/node_modules/isexe/index.js:42:5
gyp verb `which` failed at /usr/src/app/node_modules/isexe/mode.js:8:5
gyp verb `which` failed at FSReqCallback.oncomplete (fs.js:161:21)
gyp verb `which` failed python2 { Error: not found: python2
gyp verb `which` failed at getNotFoundError (/usr/src/app/node_modules/which/which.js:13:12)
gyp verb `which` failed at F (/usr/src/app/node_modules/which/which.js:68:19)
gyp verb `which` failed at E (/usr/src/app/node_modules/which/which.js:80:29)
gyp verb `which` failed at /usr/src/app/node_modules/which/which.js:89:16
gyp verb `which` failed at /usr/src/app/node_modules/isexe/index.js:42:5
gyp verb `which` failed at /usr/src/app/node_modules/isexe/mode.js:8:5
gyp verb `which` failed at FSReqCallback.oncomplete (fs.js:161:21)
gyp verb `which` failed stack:
gyp verb `which` failed 'Error: not found: python2\n at getNotFoundError (/usr/src/app/node_modules/which/which.js:13:12)\n at F (/usr/src/app/node_modules/which/which.js:68:19)\n at E (/usr/src/app/node_modules/which/which.js:80:29)\n at /usr/src/app/node_modules/which/which.js:89:16\n at /usr/src/app/node_modules/isexe/index.js:42:5\n at /usr/src/app/node_modules/isexe/mode.js:8:5\n at FSReqCallback.oncomplete (fs.js:161:21)',
gyp verb `which` failed code: 'ENOENT' }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` failed Error: not found: python
gyp verb `which` failed at getNotFoundError (/usr/src/app/node_modules/which/which.js:13:12)
gyp verb `which` failed at F (/usr/src/app/node_modules/which/which.js:68:19)
gyp verb `which` failed at E (/usr/src/app/node_modules/which/which.js:80:29)
gyp verb `which` failed at /usr/src/app/node_modules/which/which.js:89:16
gyp verb `which` failed at /usr/src/app/node_modules/isexe/index.js:42:5
gyp verb `which` failed at /usr/src/app/node_modules/isexe/mode.js:8:5
gyp verb `which` failed at FSReqCallback.oncomplete (fs.js:161:21)
gyp verb `which` failed python { Error: not found: python
gyp verb `which` failed at getNotFoundError (/usr/src/app/node_modules/which/which.js:13:12)
gyp verb `which` failed at F (/usr/src/app/node_modules/which/which.js:68:19)
gyp verb `which` failed at E (/usr/src/app/node_modules/which/which.js:80:29)
gyp verb `which` failed at /usr/src/app/node_modules/which/which.js:89:16
gyp verb `which` failed at /usr/src/app/node_modules/isexe/index.js:42:5
gyp verb `which` failed at /usr/src/app/node_modules/isexe/mode.js:8:5
gyp verb `which` failed at FSReqCallback.oncomplete (fs.js:161:21)
gyp verb `which` failed stack:
gyp verb `which` failed 'Error: not found: python\n at getNotFoundError (/usr/src/app/node_modules/which/which.js:13:12)\n at F (/usr/src/app/node_modules/which/which.js:68:19)\n at E (/usr/src/app/node_modules/which/which.js:80:29)\n at /usr/src/app/node_modules/which/which.js:89:16\n at /usr/src/app/node_modules/isexe/index.js:42:5\n at /usr/src/app/node_modules/isexe/mode.js:8:5\n at FSReqCallback.oncomplete (fs.js:161:21)',
gyp verb `which` failed code: 'ENOENT' }
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (/usr/src/app/node_modules/node-gyp/lib/configure.js:484:19)
gyp ERR! stack at PythonFinder.<anonymous> (/usr/src/app/node_modules/node-gyp/lib/configure.js:406:16)
gyp ERR! stack at F (/usr/src/app/node_modules/which/which.js:68:16)
gyp ERR! stack at E (/usr/src/app/node_modules/which/which.js:80:29)
gyp ERR! stack at /usr/src/app/node_modules/which/which.js:89:16
gyp ERR! stack at /usr/src/app/node_modules/isexe/index.js:42:5
gyp ERR! stack at /usr/src/app/node_modules/isexe/mode.js:8:5
gyp ERR! stack at FSReqCallback.oncomplete (fs.js:161:21)
gyp ERR! System Linux 4.9.93-linuxkit-aufs
gyp ERR! command "/usr/local/bin/node" "/usr/src/app/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /usr/src/app/node_modules/@angular-devkit/build-angular/node_modules/node-sass
gyp ERR! node -v v11.0.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
Our build worked just yesterday, pulling the latest node:alpine image. Downgrading to node:10.13.0-alpine temporarily fixed our problem
I should note, running node v11.1.0 and npm 6.4.1 locally works great running an npm install on our projects, so we have narrowed it down fully to node:alpine.
Not an issue with the image, node-sass doesn't support Node 11 yet
See my comment above. It works just fine with Node 11 locally, and it worked with node:alpine just yesterday when it used Node 11.0.0 and whatever version of yarn it did. Only today's changes seemed to break things.
OK, I'm one of the maintainers for node-sass and we don't yet support Node 11 so the message your seeing above in the container is expected as there is no prebuilt binaries. On you local machine you have the full node-gyp build dependencies like python that allow a fallback to a local build. The images don't contain those tools, see https://github.com/nodejs/docker-node/issues/860 about adding them to your image if you want to use Node 11 and node-sass
Most helpful comment
OK, I'm one of the maintainers for node-sass and we don't yet support Node 11 so the message your seeing above in the container is expected as there is no prebuilt binaries. On you local machine you have the full node-gyp build dependencies like python that allow a fallback to a local build. The images don't contain those tools, see https://github.com/nodejs/docker-node/issues/860 about adding them to your image if you want to use Node 11 and node-sass