gpt4 book ai didi

node.js - 无法在 mac 上使用 NPM 安装 lessc

转载 作者:太空宇宙 更新时间:2023-11-03 23:36:25 34 4
gpt4 key购买 nike

我试图在我的Mac上全局安装lessc,我从他们的网站安装了node.js,当我运行命令(npm install -g less)时,我得到了这个,你能帮我吗,我只想要做的就是安装 Less 并使 less2css 编译器在 sublimetext 3 上正常工作:

npm install -g less
npm WARN locking Error: EACCES, open '/Users/Mohammad/.npm/_locks/less-c2213c903e2e7354.lock'
npm WARN locking at Error (native)
npm WARN locking /Users/Mohammad/.npm/_locks/less-c2213c903e2e7354.lock failed { [Error: EACCES, open '/Users/Mohammad/.npm/_locks/less-c2213c903e2e7354.lock']
npm WARN locking errno: -13,
npm WARN locking code: 'EACCES',
npm WARN locking path: '/Users/Mohammad/.npm/_locks/less-c2213c903e2e7354.lock' }
npm ERR! Darwin 14.4.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "less"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3

npm ERR! Attempt to unlock /usr/local/lib/node_modules/less, which hasn't been locked
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR! /Users/Mohammad/npm-debug.log
MacBook-Pro:~ Mohammad$ npm install -g less
npm WARN locking Error: EACCES, open '/Users/Mohammad/.npm/_locks/less-c2213c903e2e7354.lock'
npm WARN locking at Error (native)
npm WARN locking /Users/Mohammad/.npm/_locks/less-c2213c903e2e7354.lock failed { [Error: EACCES, open '/Users/Mohammad/.npm/_locks/less-c2213c903e2e7354.lock']
npm WARN locking errno: -13,
npm WARN locking code: 'EACCES',
npm WARN locking path: '/Users/Mohammad/.npm/_locks/less-c2213c903e2e7354.lock' }
npm ERR! Darwin 14.4.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "less"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3

npm ERR! Attempt to unlock /usr/local/lib/node_modules/less, which hasn't been locked
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR! /Users/Mohammad/npm-debug.log

最佳答案

如果您没有 /usr/local 目录的写入权限,则需要以 super 用户身份执行此命令。

请尝试:

sudo npm install -g less

关于node.js - 无法在 mac 上使用 NPM 安装 lessc,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31772813/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com