代码改变世界

node.js npm权限问题try running this command again as root/Administrator.

  youxin  阅读(1003)  评论(0编辑  收藏  举报

npm install报错;

try running this command again as root/Administrator.

 

以管理员身份打开cmd

开始菜单-》所有程序-》附件,找到cmd,然后右键,以管理员身份运行。

 

看:http://blogs.msdn.com/b/matt-harrington/archive/2012/02/23/how-to-fix-node-js-npm-permission-problems.aspx

It turns out that you don’t have to run the command again as Administrator, and doing so won’t fix the problem.  Try npm cache clean first.  If that doesn’t fix things, take a look in%APPDATA%\npm-cache, or if you’re using PowerShell, $env:APPDATA\npm-cache.  After cleaning the cache, you may still be left with remnants.  Manually remove everything in that directory, and try again.  This has always fixed things for me.

 一个回答:

在MAC上安装webpack以及reactjs等其它组件时,安装太慢卡住不动,直接ctrl+c终止后,再npm install后出npm WARN unmet dependency错误,npm cache clean后也不行。

解决方法是直接把当前的node_modules目录删除掉,重新npm install恢复正常。

编辑推荐:
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
历史上的今天:
2014-02-24 TCP 协议
2014-02-24 tcp抓包 Wireshark 使用
2014-02-24 (转)linux中常用的头文件
2014-02-24 ubuntu安装使用kdevelop
2013-02-24 jquery ajax loading效果
2013-02-24 jquery ajax基本操作
2013-02-24 php中count 多维数组长度统计实现方法
点击右上角即可分享
微信分享提示