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

Update Node-sass in order to reduce build time #469

Open
dvvanessastoiber opened this issue Mar 15, 2021 · 6 comments
Open

Update Node-sass in order to reduce build time #469

dvvanessastoiber opened this issue Mar 15, 2021 · 6 comments
Assignees
Labels
priority: medium type: refactor Refactor the current implementation

Comments

@dvvanessastoiber
Copy link
Contributor

We are currently using node-sass v4.13.1 which does not support Node v14 (see https://github.com/sass/node-sass/releases). In order to reduce the build time, we should update to v4.14.1 or v5.0.0 if possible.

@dvvanessastoiber dvvanessastoiber added priority: medium type: refactor Refactor the current implementation labels Mar 15, 2021
@dvvanessastoiber dvvanessastoiber self-assigned this Mar 15, 2021
@keckelt
Copy link
Member

keckelt commented Sep 29, 2021

+1 🙂

To add to that, here's a table showing which node-sass versions are compatible with which node versions: https://github.com/sass/node-sass#node-version-support-policy

The node bindings, available from the node-sass releases have the naming scheme: -<Architecture-_binding.node.
For v4.13.1, and Node 14, we wold need linux-x64-83_binding.node, which is not availabe. Therefore, node-sass has to be built from source.

@thinkh
Copy link
Contributor

thinkh commented Sep 29, 2021

Maybe we can switch to Dart Sass? See #438 and #439

@keckelt
Copy link
Member

keckelt commented Sep 29, 2021

Didn't notice you already had a PR for that.
Probably the easier approach 😉

@keckelt
Copy link
Member

keckelt commented Oct 4, 2021

Today i also got build errors during the node-sass build: https://app.circleci.com/pipelines/github/Caleydo/cohort_product/729/workflows/6df51428-bffa-4e94-b428-f9479cf3baa7/jobs/984

node-sass downloads Node headers for the build, which fails with a 404 error:

> node-sass@4.13.1 postinstall /home/circleci/phovea/tmp0_cohor/node_modules/node-sass
> node scripts/build.js

Building: /usr/local/bin/node /home/circleci/phovea/tmp0_cohor/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 [
gyp verb cli   '/usr/local/bin/node',
gyp verb cli   '/home/circleci/phovea/tmp0_cohor/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 verb cli ]
gyp info using node-gyp@3.8.0
gyp info using node@14.18.0 | 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` succeeded python2 /usr/bin/python2
gyp verb check python version `/usr/bin/python2 -c "import sys; print "2.7.16
gyp verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j
gyp verb get node dir no --target version specified, falling back to host node version: 14.18.0
gyp verb command install [ '14.18.0' ]
gyp verb install input version string "14.18.0"
gyp verb install installing version: 14.18.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 14.18.0
gyp verb ensuring nodedir is created /home/circleci/.node-gyp/14.18.0
gyp verb created nodedir /home/circleci/.node-gyp
gyp http GET https://nodejs.org/download/release/v14.18.0/node-v14.18.0-headers.tar.gz
gyp http 404 https://nodejs.org/download/release/v14.18.0/node-v14.18.0-headers.tar.gz
gyp WARN install got an error, rolling back install
gyp verb command remove [ '14.18.0' ]
gyp verb remove using node-gyp dir: /home/circleci/.node-gyp
gyp verb remove removing target version: 14.18.0
gyp verb remove removing development files for version: 14.18.0
gyp ERR! configure error 
gyp ERR! stack Error: 404 response downloading https://nodejs.org/download/release/v14.18.0/node-v14.18.0-headers.tar.gz
gyp ERR! stack     at Request.<anonymous> (/home/circleci/phovea/tmp0_cohor/node_modules/node-gyp/lib/install.js:214:14)
gyp ERR! stack     at Request.emit (events.js:412:35)
gyp ERR! stack     at Request.onRequestResponse (/home/circleci/phovea/tmp0_cohor/node_modules/request/request.js:1059:10)
gyp ERR! stack     at ClientRequest.emit (events.js:400:28)
gyp ERR! stack     at HTTPParser.parserOnIncomingClient (_http_client.js:647:27)
gyp ERR! stack     at HTTPParser.parserOnHeadersComplete (_http_common.js:127:17)
gyp ERR! stack     at TLSSocket.socketOnData (_http_client.js:515:22)
gyp ERR! stack     at TLSSocket.emit (events.js:400:28)
gyp ERR! stack     at addChunk (internal/streams/readable.js:293:12)
gyp ERR! stack     at readableAddChunk (internal/streams/readable.js:267:9)
gyp ERR! System Linux 4.15.0-1106-aws
gyp ERR! command "/usr/local/bin/node" "/home/circleci/phovea/tmp0_cohor/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /home/circleci/phovea/tmp0_cohor/node_modules/node-sass
gyp ERR! node -v v14.18.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^2.1.2 (node_modules/jest-haste-map/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/watchpack-chokidar2/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/webpack-dev-server/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN react-plotly.js@2.5.1 requires a peer of plotly.js@>1.34.0 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.13.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-sass@4.13.1 postinstall 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!     /home/circleci/.npm/_logs/2021-10-04T11_09_09_861Z-debug.log
npm status code 1 null
ERROR building  cohort Error: npm failed with status code 1 null
    at ChildProcess.<anonymous> (/home/circleci/phovea/build.js:212:16)
    at ChildProcess.emit (events.js:400:28)
    at maybeClose (internal/child_process.js:1058:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)
ERROR extra building  Error: npm failed with status code 1 null
    at ChildProcess.<anonymous> (/home/circleci/phovea/build.js:212:16)
    at ChildProcess.emit (events.js:400:28)
    at maybeClose (internal/child_process.js:1058:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)

Exited with code exit status 1

CircleCI received exit code 1

The link works fine on my machine though, so maybe they blocked CircleCI?


EDIT 07/10/2021: Had the same error again today.

@keckelt
Copy link
Member

keckelt commented Oct 4, 2021

is there a way to overwrite the node-sass version from the product?

@keckelt
Copy link
Member

keckelt commented Feb 14, 2022

I guess this is obsolete now due to #439

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: medium type: refactor Refactor the current implementation
Projects
None yet
Development

No branches or pull requests

3 participants