前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >node-sass 在 jenkins 中因为权限无法安装的问题

node-sass 在 jenkins 中因为权限无法安装的问题

作者头像
前Thoughtworks-杨焱
发布2022-02-19 10:30:02
2.3K0
发布2022-02-19 10:30:02
举报
文章被收录于专栏:杨焱的专栏杨焱的专栏

发表于2018-05-152019-01-01 作者 wind

这个问题发现了好多次了,今天应该是找到了正确的解决方式:

我使用 whoami 输出执行命令的用户是 root,但是 node 执行安装node-sass时调用了 mkdir 以及调用 binding.node 没有权限。然后试了一下使用 sudo 来执行 rebuild node-sass ,就成功了。这是我的日志:

代码语言:javascript
复制
+ npm install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

up to date in 10.108s
+ whoami
root
+ sudo npm rebuild node-sass --save-dev
> node-sass@4.9.0 install /var/lib/jenkins/workspace/【测试环境】XXX-后台网页/node_modules/node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.9.0/linux-x64-57_binding.node
Download complete
Binary saved to /var/lib/jenkins/workspace/【测试环境】XXX-后台网页/node_modules/node-sass/vendor/linux-x64-57/binding.node
Caching binary to /root/.npm/node-sass/4.9.0/linux-x64-57_binding.node

> node-sass@4.9.0 postinstall /var/lib/jenkins/workspace/【测试环境】XXX-后台网页/node_modules/node-sass
> node scripts/build.js

Binary found at /var/lib/jenkins/workspace/【测试环境】XXX-后台网页/node_modules/node-sass/vendor/linux-x64-57/binding.node
Testing binary
Binary is fine
node-sass@4.9.0 /var/lib/jenkins/workspace/【测试环境】XXX-后台网页/node_modules/node-sass
+ npm run build:itl

> base4j-ui@1.0.1 build:itl /var/lib/jenkins/workspace/【测试环境】XXX-后台网页
> cross-env NODE_ENV=production node build/build_xxx.js

production
Starting to optimize CSS...
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2018-05-15,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档