简体   繁体   English

npm无法发布我的模块

[英]npm can not publish my module

I am trying to publish my module to see how it works. 我试图发布我的模块,看看它是如何工作的。

I installed npm and then created my very simple module. 我安装了npm然后创建了我非常简单的模块。

I used npm add user to add myself as a new user. 我使用npm add user将自己添加为新用户。 I received the following message: Logged in as david1994 on https://registry.npmjs.org/ 我收到以下消息: Logged in as david1994 on https://registry.npmjs.org/

Then I tried to publish my module with npm publish , but I got the following error: 然后我尝试用npm publish发布我的模块npm publish ,但是我收到以下错误:

npm ERR! code: 'EPERM',
npm ERR! syscall: 'open',
npm ERR! path: 'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\supermodule\\npm-debug.log.1866747129' }

But I can not see any npm-debug.log in my module directory. 但我在模块目录中看不到任何npm-debug.log

Possible it looks like a module with that name was already published by someone else, so you'd need to use a different name, or use a scope if you really want to keep the same name. 可能看起来具有该名称的模块已经由其他人发布,因此您需要使用不同的名称,或者如果您真的想要保留相同的名称则使用范围。

could you check that the name is not already taken by someone else, as well? 你能检查一下这个名字还没有被别人带走吗?

read more 阅读更多

The EPERM error indicates that there is a problem opening a file as the npm publish command does not seem to have permission to access to that file. EPERM错误表示打开文件时出现问题,因为npm publish命令似乎没有访问该文件的权限。

The name of the file giving you the problem should be found in the report file ... 应该在报告文件中找到提供问题的文件的名称...

debug.log.1866747129

in the following directory ... 在以下目录中......

C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\supermodule\\ C:\\ Program Files \\ nodejs \\ node_modules \\ npm \\ node_modules \\ supermodule \\

If for some reason you cannot access the above file run the publish step again using --dd flag which will increase the amount of logging that you see on the screen should help you troubleshoot your problem 如果由于某种原因您无法访问上述文件,请使用--dd标志再次运行发布步骤,这将增加您在屏幕上看到的日志记录量,可帮助您解决问题

See npm config for a full list of command line parameters that can help you troubleshoot this problem. 请参阅npm config以获取可帮助您解决此问题的命令行参数的完整列表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM