sass / node-sass

:rainbow: Node.js bindings to libsass

Home Page:https://npmjs.org/package/node-sass

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ARM64 CPU deployment support

FreemanKevin opened this issue · comments

commented
...
npm info lifecycle trim-newlines@1.0.0~install: trim-newlines@1.0.0
npm info lifecycle meow@3.7.0~install: meow@3.7.0
npm info lifecycle true-case-path@1.0.3~install: true-case-path@1.0.3
npm info lifecycle tunnel-agent@0.6.0~install: tunnel-agent@0.6.0
npm info lifecycle tweetnacl@0.14.5~install: tweetnacl@0.14.5
npm info lifecycle bcrypt-pbkdf@1.0.2~install: bcrypt-pbkdf@1.0.2
npm info lifecycle sshpk@1.17.0~install: sshpk@1.17.0
npm info lifecycle core-util-is@1.0.2~install: core-util-is@1.0.2
npm info lifecycle verror@1.10.0~install: verror@1.10.0
npm info lifecycle jsprim@1.4.2~install: jsprim@1.4.2
npm info lifecycle http-signature@1.2.0~install: http-signature@1.2.0
npm info lifecycle request@2.88.2~install: request@2.88.2
npm info lifecycle wide-align@1.1.5~install: wide-align@1.1.5
npm info lifecycle gauge@2.7.4~install: gauge@2.7.4
npm info lifecycle npmlog@4.1.2~install: npmlog@4.1.2
npm info lifecycle node-gyp@3.8.0~install: node-gyp@3.8.0
npm info lifecycle node-sass@4.14.1~install: node-sass@4.14.1

> node-sass@4.14.1 install /root/npmbuilder/gd-assets-ui/node_modules/node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.14.1/linux-arm64-83_binding.node
...
gyp verb command build []
gyp verb build type Release
gyp verb architecture arm64
gyp verb node dev dir /root/.node-gyp/14.15.4
gyp verb `which` succeeded for `make` /usr/bin/make
gyp info spawn make
gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/root/npmbuilder/gd-assets-ui/node_modules/node-sass/build'
  g++ '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DLIBSASS_VERSION="3.5.5"' -I/root/.node-gyp/14.15.4/include/node -I/root/.node-gyp/14.15.4/src -I/root/.node-gyp/14.15.4/deps/openssl/config -I/root/.node-gyp/14.15.4/deps/openssl/openssl/include -I/root/.node-gyp/14.15.4/deps/uv/include -I/root/.node-gyp/14.15.4/deps/zlib -I/root/.node-gyp/14.15.4/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -O3 -fno-omit-frame-pointer -std=gnu++1y -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/ast.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/ast.o ../src/libsass/src/ast.cpp
make: g++: Not a directory
make: *** [src/libsass.target.mk:158: Release/obj.target/libsass/src/libsass/src/ast.o] Error 127
make: Leaving directory '/root/npmbuilder/gd-assets-ui/node_modules/node-sass/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/root/npmbuilder/gd-assets-ui/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Linux 4.19.90-24.4.v2101.ky10.aarch64
gyp ERR! command "/usr/bin/node-v14.15.4-linux-arm64/bin/node" "/root/npmbuilder/gd-assets-ui/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /root/npmbuilder/gd-assets-ui/node_modules/node-sass
gyp ERR! node -v v14.15.4
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm info lifecycle node-sass@4.14.1~postinstall: Failed to exec postinstall script
npm timing action:postinstall Completed in 622ms
npm timing stage:rollbackFailedOptional Completed in 152ms
npm timing stage:runTopLevelLifecycles Completed in 73309ms
npm WARN @vssue/vuepress-plugin-vssue@1.4.8 requires a peer of vuepress@^1.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN vue-echarts@6.5.2 requires a peer of vue@^2.6.12 || ^3.1.1 but none is installed. You must install peer dependencies yourself.
npm WARN vue-multiple-module@0.0.1 No repository field.
npm WARN The package worker-loader is included as both a dev and production dependency.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (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":"arm64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/webpack-dev-server/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":"arm64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/watchpack-chokidar2/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":"arm64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.14.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.14.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm timing npm Completed in 75092ms

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2023-02-06T10_41_34_796Z-debug.log

According to the previous issue, it is not supported, but it is still unclear what is the reason.

Due to political reasons between mainland China and the United States, mainland China has basically fully promoted the deployment of CPUs using the ARM64 architecture, especially at the national level.

If you see this question and answer, can you give us the reasons for not doing ARM64 support? In addition, if we have to run the business under ARM64, is there any solution for relying on node-sass? thanks.

If you install the C++ compiler (like g++) and the libraries, it should build from source and work.

commented

Excuse me, can you be more specific? Do you mean that the arm64 environment is now supported?

The error you are seeing is caused by the fact that the machine you are installing node-sass on does not have C++ development environment installed.

node-sass team does not provide pre-built binary releases for arm64 and other platforms (check out the https://github.com/sass/node-sass/releases/tag/v8.0.0 release for example).

However, if you install C++ compiler you can build the binary extension file yourself, and distribute it to your deployments separately.