Loading [MathJax]/jax/output/CommonHTML/config.js
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >cmd管理员模式运行“'npm install -g npm”安装npm时报错?

cmd管理员模式运行“'npm install -g npm”安装npm时报错?

提问于 2022-03-01 07:18:15
回答 1关注 0查看 608

在腾讯云win10 windows Server2016下用cmd管理员模式运行“'sudo npm install -g npm”安装npm时报错,如下图:

求助!!!!急

完整日志:

2022-03-01T06_47_20_705Z-debug.zip

日志如下:

代码语言:js
AI代码解释
复制
timing action:finalize Completed in 1002ms
3270 verbose unlock done using C:\Users\Administrator\AppData\Roaming\npm-cache\_locks\staging-abc99ad82fab7dbe.lock for C:\Users\Administrator\AppData\Roaming\npm\node_modules\.staging
3271 timing stage:rollbackFailedOptional Completed in 9ms
3272 timing stage:runTopLevelLifecycles Completed in 12832ms
3273 verbose stack Error: EPERM: operation not permitted, rename 'C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\node_modules\.node-gyp.DELETE\node_modules\@tootallnate' -> 'C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\node_modules\@tootallnate'
3274 verbose cwd C:\GreaterWMS\templates
3275 verbose Windows_NT 10.0.14393
3276 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "npm"
3277 verbose node v14.16.1
3278 verbose npm  v6.14.12
3279 error code EPERM
3280 error syscall rename
3281 error path C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\node_modules\.node-gyp.DELETE\node_modules\@tootallnate
3282 error dest C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\node_modules\@tootallnate
3283 error errno -4048
3284 error Error: EPERM: operation not permitted, rename 'C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\node_modules\.node-gyp.DELETE\node_modules\@tootallnate' -> 'C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\node_modules\@tootallnate'
3284 error  [OperationalError: EPERM: operation not permitted, rename 'C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\node_modules\.node-gyp.DELETE\node_modules\@tootallnate' -> 'C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\node_modules\@tootallnate'] {
3284 error   cause: [Error: EPERM: operation not permitted, rename 'C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\node_modules\.node-gyp.DELETE\node_modules\@tootallnate' -> 'C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\node_modules\@tootallnate'] {
3284 error     errno: -4048,
3284 error     code: 'EPERM',
3284 error     syscall: 'rename',
3284 error     path: 'C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\.node-gyp.DELETE\\node_modules\\@tootallnate',
3284 error     dest: 'C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\node_modules\\@tootallnate'
3284 error   },
3284 error   errno: -4048,
3284 error   code: 'EPERM',
3284 error   syscall: 'rename',
3284 error   path: 'C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\.node-gyp.DELETE\\node_modules\\@tootallnate',
3284 error   dest: 'C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\node_modules\\@tootallnate',
3284 error   parent: 'npm'
3284 error }
3285 error The operation was rejected by your operating system.
3285 error It's possible that the file was already in use (by a text editor or antivirus),
3285 error or that you lack permissions to access it.
3285 error
3285 error If you believe this might be a permissions issue, please double-check the
3285 error permissions of the file and its containing directories, or try running
3285 error the command again as root/Administrator.
3286 verbose exit [ -4048, true ]
已邀请
等3人回答

回答 10

用户1212736

发布于 2018-11-19 06:36:26

查了一下,原来是获取用户信息的接口更新了。

大家可以这么改:

在 pages/index/index.wxml 的清空任务状态上面补充一句

<button open-type="getUserInfo">授权用户信息</button>

然后运行之前点一下授权,就可以正常使用了。

等待你的阿公

发布于 2017-11-05 21:57:10

请重启小程序会话,看你命令你应该是配置后没有重启服务

代码语言:txt
AI代码解释
复制
pm2 restart app

我发现你在SSH上直接输入.login,这个登陆地址是在小程序上实现的,并不是在SSH上使用!

用户2157259

发布于 2018-06-10 14:46:06

app.js 里面的代码应为:

// 引用 express 来支持 HTTP Server 的实现

const express = require('express');

// 引用 wafer-session 支持小程序会话

const waferSession = require('wafer-node-session');

// 使用 MongoDB 作为会话的存储

const MongoStore = require('connect-mongo')(waferSession);

// 引入配置文件

const config = require('./config');

// 创建一个 express 实例

const app = express();

// 添加会话中间件,登录地址是 /login

app.use(waferSession({

appId: config.appId,

appSecret: config.appSecret,

loginPath: '/login',

store: new MongoStore({

url: `mongodb://${config.mongoUser}:${config.mongoPass}@${config.mongoHost}:${config.mongoPort}/${config.mongoDb}`

})

}));

// 在路由 /me 下,输出会话里包含的用户信息

app.use('/me', (request, response, next) => {

response.json(request.session ? request.session.userInfo : { noBody: true });

if (request.session) {

console.log(`Wafer session success with openId=${request.session.userInfo.openId}`);

}

});

// 实现一个中间件,对于未处理的请求,都输出 "Response from express"

app.use((request, response, next) => {

response.write('Response from express');

response.end();

});

// 监听端口,等待连接

app.listen(config.serverPort);

// 输出服务器启动日志

console.log(`Server listening at http://127.0.0.1:${config.serverPort}`);

修改后输入:pm2 restart app

即可

和开发者交流更多问题细节吧,去 写回答
相关文章
小程序客服会话
调起客服会话相关属性参考官网文档:https://developers.weixin.qq.com/miniprogram/dev/component/button.html
很酷的站长
2023/01/08
1.1K0
小程序客服会话
小程序删除后,会发生什么? | 小程序问答 #25
今天,知晓程序(微信号 zxcx0101)就来为你详细解释,小程序删除之后,到底会发生什么事情。
知晓君
2018/08/01
1.1K0
小程序删除后,会发生什么? | 小程序问答 #25
小程序无法联网,发生什么事了?| 小程序问答 #6
这里是「小程序问答」栏目的第 6 期 本周,斗图必备的「鬼畜表情包」小程序获得了知晓程序 · MINA 奖。本周还有什么新上的小程序值得玩?「晓榜」给大家一口气推荐了 10 个。 回到本期的「小程序问答」,我们解答了以下两个重要问题: 1. 我在用小程序的时候,出现了无法载入的情况,页面一片空白,这是怎么回事? 最近,知晓程序收到了非常多的类似疑问,问题基本上是「为什么这个小程序无法载入、一片空白?」 我们发现,出现该问题的用户,使用的都是 Android 系统。 经过推测,这也许是小程序的网络接口在 An
知晓君
2018/06/29
1.1K0
「小程序JAVA实战」java-sesion的状态会话与无状态会话(38)
我相信大家在参与web开发的时候,肯定会遇到session,其实在平常的开发过程中,用到的session都是有状态的session。 有状态的session 正常的web开发,每次来一个用户就会产生一
IT架构圈
2019/07/08
5450
「小程序JAVA实战」java-sesion的状态会话与无状态会话(38)
[WaferOnSCF]在SCF上的小程序会话服务器
本人小白,完全不懂PHP,原项目在代码层面无法支持多个小程序或公众号,所以在此做了修改和适配。本项目可搭配官方Wafer的客户端SDK使用,但客户端SDK需要做一定的适配修改。
囍冯总囍
2019/03/16
2.4K0
小程序-实现小程序与小程序之间的跳转
使用标签的方式跳转,非常简单,只需要在wxml中使用target,open-type,app-id,path,指定相应的参数就可以实现跳转了的
itclanCoder
2020/11/06
8.9K0
微信小程序添加悬浮在线客服会话按钮
  微信为小程序提供客服消息能力,小程序用户可以方便快捷地与小程序服务提供方进行沟通,并且已经做成了组件的形式,直接就可以调用。客服会话按钮,用于在页面上显示一个客服会话按钮,用户点击该按钮后会进入客服会话。那么如何自定义成悬浮客服会话按钮呢?随Z5Win一起来看看
ytkah
2018/09/28
3.7K0
小程序-云开发-实现生成小程序码
前言 小程序因为传播快,易分享,现已经成为各大小公司的标配,从曾今你有公众号么,变为你有小程序么?可想而知小程序的火爆程度 那么在小程序中,如何生成小程序码?虽然小程序目前可以分享到朋友圈了的,但小程
itclanCoder
2020/10/28
8K0
小程序-云开发-实现生成小程序码
微信小程序 设置cookie-保持会话持久-免登录
常规方式呢,就是后台把数据放在响应头里,即Response Header,这个里面会有我们需要持久化的信息,即Set-Cookie字段。 当然也可能是在header平级的cookies字段里,视情况而定。
yechaoa
2022/06/10
6K1
当微信小程序遇上TensorFlow:小程序实现
首先要吐槽一下微信小程序开发工具没有Linux版本,为了开发微信小程序,我不得不搬出我的娱乐机iMac。对着硕大的屏幕,看着如蚂蚁般的文字,真心想问一下,那些使用iMac做开发机的朋友们不会肩周发炎,双眼发涩么?
云水木石
2019/07/01
9220
电脑弹出当前页面的脚本发生错误_360当前页面的脚本发生错误
笔者 Windows 版本:Windows 8 Enterprise 64 位 (DirectX 11) Windows 有一天忽然开始报 “脚本错误 当前页面的脚本发生错误” 警告窗口:
全栈程序员站长
2022/11/01
1.3K0
2020年最新最全小程序支付功能实现,借助小程序云开发实现小程序支付功能
上面的邮箱验证成功以后,我们这里就要选企业了,当然如果你是个体工商户,你也可以选择个体工商户。
编程小石头
2020/12/01
9740
2020年最新最全小程序支付功能实现,借助小程序云开发实现小程序支付功能
小程序-实现竖排文字
最近我在做一个诗词类的小程序:《诗词屋》,已经上线。因为古文有从上到下,从右到左阅读和书写的习惯,所以我设计了一个摘录页面,如下: 整体布局就是按照古代人阅读习惯来的,有点韵味。但是我们如何实现上面那
前端黑板报
2018/01/29
11.4K1
小程序-实现竖排文字
小程序实现双列布局
双列布局的话特点是随着数据的增多,我们会出现偶数或者奇数的问题,如果是偶数本身已经填满了,问题不大。主要存在奇数的问题,比如我们如果有3条数据,预期实现的效果
低代码布道师
2023/10/11
3960
JAVA实现的小程序[通俗易懂]
首先,我们来看效果,一共五个颜色不相同的球,每撞击一下边界,分数加1,分数越大,球的速度越快。(效果是动态的)
全栈程序员站长
2022/09/08
1.1K0
JAVA实现的小程序[通俗易懂]
小程序录音功能实现
在开发小程序过程中,有一个实现录音功能并播放录音,将录音上传至服务器的需求。开发过程中使用了Taro框架,录音功能通过Taro.getRecorderManager()接口实现,上传录音至服务器通过Taro.uploadFile接口实现,播放录音使用Taro.createInnerAudioContext()接口实现。下面就详细介绍整个流程是如何实现的。
IT工作者
2022/02/17
3.5K0
网络请求发生错误: Unsupported Media Type
最近一个项目中要用到环信,在注册时要用授权注册,直接在app中通过接口获取token注册,在请求token时发生了一个错误,错误信息:Unsupported Media Type
全栈程序员站长
2022/08/28
7580
反编译微信小程序错误解决
$gwx is not defined和__vd_version_info__ is not defined错误解决
薛定喵君
2019/11/05
1.4K1
详解:如何监控小程序异常及处理错误?
对于小程序开发者来说,其中的错误监控一直是个头疼的问题。由于小程序开发迭代较快,会存在系统问题,机型问题和版本的兼容问题,有时候我们在自行测试中完美运行,可总是有用户抱怨使用异常。
极乐君
2020/08/20
5.8K0
点击加载更多

相似问题

架构设计架构设计中有哪些常见的设计模式?如何选择并应用?

130

Builder设计模式和Factory Design模式有什么区别?

21.1K

java 的OCR 示例怎么携带header和参数?

3270

向量数据库赛道未来竞争的核心是什么?

0102

腾讯发布的向量数据库有哪些核心能力?

0185
相关问答用户
擅长3个领域
腾讯 | 技术专家擅长2个领域
擅长4个领域
添加站长 进交流群

领取专属 10元无门槛券

AI混元助手 在线答疑

扫码加入开发者社群
关注 腾讯云开发者公众号

洞察 腾讯核心技术

剖析业界实践案例

扫码关注腾讯云开发者公众号
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档