Unable to save binary node-sass/vendor/linux-x64-72 : Error: EACCES: permission denied, mkdir
·
前言
略
错误
[root@tencent-test-01 src]# npm install
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
> node-sass@4.14.1 install /opt/h5widget/src/node_modules/node-sass
> node scripts/install.js
Unable to save binary /opt/h5widget/src/node_modules/node-sass/vendor/linux-x64-72 : Error: EACCES: permission denied, mkdir '/opt/h5widget/src/node_modules/node-sass/vendor'
at Object.mkdirSync (fs.js:823:3)
at sync (/opt/h5widget/src/node_modules/mkdirp/index.js:74:13)
at Function.sync (/opt/h5widget/src/node_modules/mkdirp/index.js:80:24)
at checkAndDownloadBinary (/opt/h5widget/src/node_modules/node-sass/scripts/install.js:114:11)
at Object.<anonymous> (/opt/h5widget/src/node_modules/node-sass/scripts/install.js:157:1)
at Module._compile (internal/modules/cjs/loader.js:959:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
at Module.load (internal/modules/cjs/loader.js:815:32)
at Function.Module._load (internal/modules/cjs/loader.js:727:14)
at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) {
errno: -13,
syscall: 'mkdir',
code: 'EACCES',
path: '/opt/h5widget/src/node_modules/node-sass/vendor'
}
> node-sass@4.14.1 postinstall /opt/h5widget/src/node_modules/node-sass
> node scripts/build.js
Building: /opt/nodejs/node-v12.13.1-linux-x64/bin/node /opt/h5widget/src/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 '/opt/nodejs/node-v12.13.1-linux-x64/bin/node',
gyp verb cli '/opt/h5widget/src/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@12.13.1 | 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.5
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: 12.13.1
gyp verb command install [ '12.13.1' ]
gyp verb install input version string "12.13.1"
gyp verb install installing version: 12.13.1
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 12.13.1
gyp verb ensuring nodedir is created /root/.node-gyp/12.13.1
gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/12.13.1"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/opt/h5widget/src/node_modules/node-sass/.node-gyp"
gyp verb tmpdir == cwd automatically will remove dev files after to save disk space
gyp verb command install [ '--node_gyp_internal_noretry', '12.13.1' ]
gyp verb install input version string "12.13.1"
gyp verb install installing version: 12.13.1
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 12.13.1
gyp verb ensuring nodedir is created /opt/h5widget/src/node_modules/node-sass/.node-gyp/12.13.1
gyp WARN install got an error, rolling back install
gyp verb command remove [ '12.13.1' ]
gyp verb remove using node-gyp dir: /opt/h5widget/src/node_modules/node-sass/.node-gyp
gyp verb remove removing target version: 12.13.1
gyp verb remove removing development files for version: 12.13.1
gyp WARN install got an error, rolling back install
gyp verb command remove [ '12.13.1' ]
gyp verb remove using node-gyp dir: /opt/h5widget/src/node_modules/node-sass/.node-gyp
gyp verb remove removing target version: 12.13.1
gyp verb remove removing development files for version: 12.13.1
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/opt/h5widget/src/node_modules/node-sass/.node-gyp'
gyp ERR! System Linux 3.10.0-1160.31.1.el7.x86_64
gyp ERR! command "/opt/nodejs/node-v12.13.1-linux-x64/bin/node" "/opt/h5widget/src/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /opt/h5widget/src/node_modules/node-sass
gyp ERR! node -v v12.13.1
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.3.2 (node_modules/chokidar/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 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 ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-05-09T03_40_46_738Z-debug.log
解决办法
npm i --unsafe-perm node-sass
参考
https://github.com/sass/node-sass/issues/2824
更多推荐



所有评论(0)