【问题标题】:I cannot install underscore in npm. Get the following error我无法在 npm 中安装下划线。得到以下错误
【发布时间】:2016-03-03 22:28:04
【问题描述】:
49 傻安装解决了 main: 'underscore.js', 49 傻安装解决版本:'1.5.2', 49 傻安装解决的 devDependencies: { phantomjs: '1.9.0-1' }, 49 傻安装解析脚本:{ test: 'phantomjs test/vendor/runner.js test/index.html?noglobals=true' }, 49 傻安装已解决的许可证:[[对象]], 49 傻安装解析文件:['underscore.js','underscore-min.js','LICENSE'], 49 傻安装解决的错误:{ url: 'https://github.com/jashkenas/underscore/issues' }, 49 傻安装解决_id:'underscore@1.5.2', 49 傻安装已解决的 dist: 49 傻安装已解决 { shasum: '1335c5e4f5e6d33bbb4b006ba8c86a00f556de08', 49 傻安装解决的压缩包:'http://registry.npmjs.org/underscore/-/underscore-1.5.2.tgz'}, 49 傻安装解决_from:'underscore@1.5.2', 49 傻安装解决_npmVersion:'1.3.5', 49 傻安装解决_npmUser:{名称:'jashkenas',电子邮件:'jashkenas@gmail.com'}, 49 傻安装解决维护者:[[对象]], 49 傻安装解析目录:{}, 49 傻安装已解决_shasum:'1335c5e4f5e6d33bbb4b006ba8c86a00f556de08', 49 傻安装解决_resolved: 'https://registry.npmjs.org/underscore/-/underscore-1.5.2.tgz' } ] 50 info install underscore@1.5.2 into /home/miguel 51 info install一个下划线@1.5.2 52 详细安装 /home/miguel 下划线之一不在飞行中;安装 53 警告锁定错误:EACCES,打开 '/home/miguel/.npm/_locks/underscore-9eac46d14df2c94b.lock' 53 警告在错误时锁定(本机) 53 警告锁定 /home/miguel/.npm/_locks/underscore-9eac46d14df2c94b.lock 失败 { [错误:EACCES,打开 '/home/miguel/.npm/_locks/underscore-9eac46d14df2c94b.lock'] 53 警告锁定错误:-13, 53 警告锁定代码:'EACCES', 53 警告锁定路径:'/home/miguel/.npm/_locks/underscore-9eac46d14df2c94b.lock'} 54 详细堆栈错误:尝试解锁尚未锁定的 /home/miguel/node_modules/underscore 解锁时的 54 个详细堆栈 (/usr/local/lib/node_modules/npm/lib/utils/locker.js:66:11) cb 的 54 个详细堆栈 (/usr/local/lib/node_modules/npm/lib/install.js:1017:5) /usr/local/lib/node_modules/npm/lib/install.js:1021:20 的 54 个详细堆栈 /usr/local/lib/node_modules/npm/lib/utils/locker.js:40:9 的 54 个详细堆栈 cb 的 54 个详细堆栈(/usr/local/lib/node_modules/npm/node_modules/lockfile/lockfile.js:149:38) /usr/local/lib/node_modules/npm/node_modules/lockfile/lockfile.js:177:38 的 54 个详细堆栈 FSReqWrap.oncomplete (fs.js:95:15) 的 54 个详细堆栈 55 详细 cwd /home/miguel 56 错误 Linux 3.13.0-55-generic 57 错误 argv “/usr/local/bin/node” “/usr/local/bin/npm” “安装” 58 错误节点 v0.12.7 59 错误 npm v2.11.3 60 错误尝试解锁 /home/miguel/node_modules/underscore,尚未锁定 61 错误 如果您需要帮助,您可以在以下位置报告此错误: 61 错误

【问题讨论】:

  • 我安装在 vim package.json { "dependencies": { "underscore": "1.5.2"} } 中创建一个文件。后来我用 => npm install 安装

标签: node.js mongodb underscore.js


【解决方案1】:

这个堆栈:

/home/miguel/.npm/_locks/underscore-9eac46d14df2c94b.lock failed { [Error: EACCES, open '/home/miguel/.npm/_locks/underscore-9eac46d14df2c94b.lock']

还有这个:

Attempt to unlock /home/miguel/node_modules/underscore, which hasn't been locked

建议是权限问题。请尝试运行此命令:

sudo chown -R $USER:$USER ~/.npm

或者:

sudo chown -R $USER:$GROUP ~/.npm

【讨论】:

    猜你喜欢
    • 2013-10-29
    • 2021-02-15
    • 1970-01-01
    • 2012-09-29
    • 2014-09-02
    • 2020-04-25
    • 2023-02-22
    • 2019-12-03
    • 1970-01-01
    相关资源
    最近更新 更多