【发布时间】:2019-04-13 17:22:31
【问题描述】:
无法通过 npm sudo npm i 安装 node-sass 包,我一直在尝试通过 sudo npm i -g node-sass --unsafe-perm=true --allow-root 解决,但它不起作用。 chmod 777 要么。
我认为有些东西具有 npm 权限,但我不知道
日志:
gyp verb build dir attempting to create "build" dir: /home/michael/Desktop/react/node_modules/node-sass/build
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/michael/Desktop/react/node_modules/node-sass/build'
gyp ERR! System Linux 4.15.0-47-generic
gyp ERR! command "/usr/bin/node" "/home/michael/Desktop/react/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /home/michael/Desktop/react/node_modules/node-sass
gyp ERR! node -v v11.14.0
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@1.2.7 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.11.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.11.0 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! /home/michael/.npm/_logs/2019-04-13T17_21_20_424Z-debug.log
【问题讨论】:
标签: javascript node.js npm