【问题标题】:Failed to Install SASS - MacOS Mojave 10.14.6无法安装 SASS - MacOS Mojave 10.14.6
【发布时间】:2020-12-10 23:34:30
【问题描述】:

今天我尝试安装 node-sass 使用:npm i -g node-sass

但它总是失败。有人可以帮忙吗?

npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!  { [Error: EACCES: permission denied, access '/usr/local/lib/node_modules']
npm ERR!   stack:
npm ERR!    'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules' }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/huynguyen/.npm/_logs/2020-08-21T14_55_03_284Z-debug.log

【问题讨论】:

  • 尝试:npm install -g sass 取自 here

标签: html css sass node-sass


【解决方案1】:

假设在 OS X 上,你可以试试

sudo chown -R $USER /usr/local/lib/node_modules

这样huynguyen 将拥有写入权限。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-05-30
    • 2019-12-22
    • 2020-02-11
    • 2021-04-16
    • 2019-06-15
    • 1970-01-01
    • 1970-01-01
    • 2020-07-16
    相关资源
    最近更新 更多