npm publish 发布失败

npm publish 发布失败

https://img1.sycdn.imooc.com//climg/6408b1960993591919660392.jpg

我在

async uploadComponentToNpm() {

// 完成组件上传NPM

if (this.isComponent()) {

log.info('开始发布NPM');

require('child_process').execSync('npm publish', {

cwd: this.dir,

});

log.success('NPM发布成功');

}

} 执行这一段时,需要输入 Enter OTP: xxx 要处修改上面的代码?


正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

1回答
提问者 慕后端7439710 2023-03-09 01:20:29

npm notice total files:   16                                      

npm notice 

npm notice Publishing to https://registry.npmjs.org/

npm ERR! code EOTP

npm ERR! This operation requires a one-time password from your authenticator.

npm ERR! You can provide a one-time password by passing --otp=<code> to the command you ran.

npm ERR! If you already provided a one-time password then it is likely that you either typoed

npm ERR! it, or it timed out. Please try again.


  • 提问者 慕后端7439710 #1

    已处理OK

    stdio: 'inherit',

    2023-03-09 01:56:12
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师