一、报错信息

Unable to save binary /var/lib/jenkins/workspace/news-html5-test/node_modules/node-sass/vendor/freebsd-x64-48 : { Error: EACCES: permission denied, mkdir '/var/lib/jenkins/workspace/news-html5-test/node_modules/node-sass/vendor'
    at Error (native)
    at Object.fs.mkdirSync (fs.js:932:18)
    at sync (/var/lib/jenkins/workspace/news-html5-test/node_modules/mkdirp/index.js:71:13)
    at Function.sync (/var/lib/jenkins/workspace/news-html5-test/node_modules/mkdirp/index.js:77:24)
    at checkAndDownloadBinary (/var/lib/jenkins/workspace/news-html5-test/node_modules/node-sass/scripts/install.js:114:11)
    at Object.<anonymous> (/var/lib/jenkins/workspace/news-html5-test/node_modules/node-sass/scripts/install.js:157:1)
    at Module._compile (module.js:577:32)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
  errno: -13,
  code: 'EACCES',
  syscall: 'mkdir',
  path: '/var/lib/jenkins/workspace/news-html5-test/node_modules/node-sass/vendor' }
> node-sass@4.9.3 install /var/lib/jenkins/workspace/news-html5-test/node_modules/node-sass
> node scripts/install.js

Unable to save binary /var/lib/jenkins/workspace/news-html5-test/node_modules/node-sass/vendor/freebsd-x64-48 : { Error: EACCES: permission denied, mkdir '/var/lib/jenkins/workspace/news-html5-test/node_modules/node-sass/vendor'
    at Error (native)
    at Object.fs.mkdirSync (fs.js:932:18)
    at sync (/var/lib/jenkins/workspace/news-html5-test/node_modules/mkdirp/index.js:71:13)
    at Function.sync (/var/lib/jenkins/workspace/news-html5-test/node_modules/mkdirp/index.js:77:24)
    at checkAndDownloadBinary (/var/lib/jenkins/workspace/news-html5-test/node_modules/node-sass/scripts/install.js:114:11)
    at Object.<anonymous> (/var/lib/jenkins/workspace/news-html5-test/node_modules/node-sass/scripts/install.js:157:1)
    at Module._compile (module.js:577:32)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
  errno: -13,
  code: 'EACCES',
  syscall: 'mkdir',
  path: '/var/lib/jenkins/workspace/news-html5-test/node_modules/node-sass/vendor' }

二、解决方法

在npm instal之前添加如下脚本

npm config set user 0 
npm config set unsafe-perm true

提示:更多内容可以访问Clang’s Blog:https://www.clang.asia

GitHub 加速计划 / no / node-sass
8.5 K
1.33 K
下载
:rainbow: Node.js bindings to libsass
最近提交(Master分支:2 个月前 )
6081731a Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3 to 4. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> 9 个月前
62c0f46c Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> 9 个月前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐