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

linux下如何编译 ? #226

Open
ccshuibuxing opened this issue Aug 16, 2024 · 1 comment
Open

linux下如何编译 ? #226

ccshuibuxing opened this issue Aug 16, 2024 · 1 comment

Comments

@ccshuibuxing
Copy link

  • 问题描述
    在ubuntu系统中,编译失败,一直提示node-sass安装不上,是不能在linux下编译吗?

  • 环境
    ubunutu 22.04
    node:v20.16.0
    npm:10.8.1

  • 错误信息

npm error code 1
npm error path /root/dootask/node_modules/node-sass
npm error command failed
npm error command sh -c node scripts/build.js
npm error Building: /usr/bin/node /root/dootask/node_modules/node-sass/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm error gyp info it worked if it ends with ok
npm error gyp verb cli [
npm error gyp verb cli   '/usr/bin/node',
npm error gyp verb cli   '/root/dootask/node_modules/node-sass/node_modules/node-gyp/bin/node-gyp.js',
npm error gyp verb cli   'rebuild',
npm error gyp verb cli   '--verbose',
npm error gyp verb cli   '--libsass_ext=',
npm error gyp verb cli   '--libsass_cflags=',
npm error gyp verb cli   '--libsass_ldflags=',
npm error gyp verb cli   '--libsass_library='
npm error gyp verb cli ]
npm error gyp info using [email protected]
npm error gyp info using [email protected] | linux | x64
npm error gyp verb command rebuild []
npm error gyp verb command clean []
npm error gyp verb clean removing "build" directory
npm error gyp verb command configure []
npm error gyp verb find Python Python is not set from command line or npm configuration
npm error gyp verb find Python Python is not set from environment variable PYTHON
npm error gyp verb find Python checking if "python3" can be used
npm error gyp verb find Python - executing "python3" to get executable path
npm error gyp verb find Python - executable path is "/usr/local/bin/python3"
npm error gyp verb find Python - executing "/usr/local/bin/python3" to get version
npm error gyp verb find Python - version is "3.10.0"
npm error gyp info find Python using Python version 3.10.0 found at "/usr/local/bin/python3"
npm error gyp verb get node dir no --target version specified, falling back to host node version: 20.16.0
npm error gyp verb command install [ '20.16.0' ]
npm error gyp verb install input version string "20.16.0"
npm error gyp verb install installing version: 20.16.0
npm error gyp verb install --ensure was passed, so won't reinstall if already installed
npm error gyp verb install version is already installed, need to check "installVersion"
npm error gyp verb got "installVersion" 9
npm error gyp verb needs "installVersion" 9
npm error gyp verb install version is good
npm error gyp verb get node dir target node version installed: 20.16.0
npm error gyp verb build dir attempting to create "build" dir: /root/dootask/node_modules/node-sass/build
npm error gyp verb build dir "build" dir needed to be created? /root/dootask/node_modules/node-sass/build
npm error gyp verb build/config.gypi creating config file
npm error gyp ERR! UNCAUGHT EXCEPTION 
npm error gyp ERR! stack TypeError: Cannot assign to read only property 'cflags' of object '#<Object>'
npm error gyp ERR! stack     at createConfigFile (/root/dootask/node_modules/node-sass/node_modules/node-gyp/lib/configure.js:117:21)
npm error gyp ERR! stack     at /root/dootask/node_modules/node-sass/node_modules/node-gyp/lib/configure.js:84:9
npm error gyp ERR! stack     at FSReqCallback.oncomplete (node:fs:187:23)
npm error gyp ERR! System Linux 5.15.0-113-generic
npm error gyp ERR! command "/usr/bin/node" "/root/dootask/node_modules/node-sass/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm error gyp ERR! cwd /root/dootask/node_modules/node-sass
npm error gyp ERR! node -v v20.16.0
npm error gyp ERR! node-gyp -v v7.1.2
npm error gyp ERR! Node-gyp failed to build your package.
npm error gyp ERR! Try to update npm and/or node-gyp and if it does not help file an issue with the package author.
npm error Build failed with error code: 7
npm error A complete log of this run can be found in: /root/.npm/_logs/2024-08-16T10_58_14_405Z-debug-0.log
@gwokwong
Copy link
Collaborator

是安装还是编译

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants