Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/42.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/128.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 发布grunt插件时遇到问题_Node.js_Gruntjs - Fatal编程技术网

Node.js 发布grunt插件时遇到问题

Node.js 发布grunt插件时遇到问题,node.js,gruntjs,Node.js,Gruntjs,我制作了我的第一个grunt插件,当我尝试运行npm publish时,我得到了一个need auth错误,因此我运行npm adduser并在写入我的用户名和密码后,我得到了以下错误: npm ERR! Error: default value must be string or number npm ERR! at read (/usr/lib/node_modules/npm/node_modules/read/lib/read.js:15:11) npm ERR! at

我制作了我的第一个grunt插件,当我尝试运行
npm publish
时,我得到了一个
need auth
错误,因此我运行
npm adduser
并在写入我的用户名和密码后,我得到了以下错误:

npm ERR! Error: default value must be string or number
npm ERR!     at read (/usr/lib/node_modules/npm/node_modules/read/lib/read.js:15:11)
npm ERR!     at readEmail (/usr/lib/node_modules/npm/lib/adduser.js:96:3)
npm ERR!     at loop (/usr/lib/node_modules/npm/lib/adduser.js:33:20)
npm ERR!     at /usr/lib/node_modules/npm/lib/adduser.js:89:5
npm ERR!     at Interface.onLine (/usr/lib/node_modules/npm/node_modules/read/lib/read.js:111:5)
npm ERR!     at Interface.EventEmitter.emit (events.js:95:17)
npm ERR!     at Interface._onLine (readline.js:202:10)
npm ERR!     at Interface._line (readline.js:531:8)
npm ERR!     at Interface._ttyWrite (readline.js:760:14)
npm ERR!     at ReadStream.onkeypress (readline.js:99:10)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm错误!错误:默认值必须是字符串或数字
npm错误!读取时(/usr/lib/node_modules/npm/node_modules/read/lib/read.js:15:11)
npm错误!在readEmail(/usr/lib/node_modules/npm/lib/adduser.js:96:3)
npm错误!at循环(/usr/lib/node_modules/npm/lib/adduser.js:33:20)
npm错误!at/usr/lib/node_modules/npm/lib/adduser.js:89:5
npm错误!在Interface.onLine(/usr/lib/node_modules/npm/node_modules/read/lib/read.js:111:5)
npm错误!位于Interface.EventEmitter.emit(events.js:95:17)
npm错误!在接口处在线(readline.js:202:10)
npm错误!在接口处。\u行(readline.js:531:8)
npm错误!在接口处写入(readline.js:760:14)
npm错误!在ReadStream.onkeypress(readline.js:99:10)
npm错误!如果您需要帮助,可以报告此*整个*日志,
npm错误!包括npm和节点版本,位于:
npm错误!
我做错了什么


我认为我的代码与“adduser”操作无关,但无论如何,代码如下:

这是npm的已知错误:

使用更新至npm的最新版本:
npm安装npm-g


然后删除您的
~/.npmrc
文件。最后再次运行
npm adduser
命令。

如果您想要任何答案,您可能应该发布相关的源代码。我不知道源代码与添加用户相关。这就是代码:如果您认为错误消息是相关的,并且错误消息列出了源代码中的行号,那么(部分)源代码必须是相关的,这似乎是有道理的。我的意思是,添加用户似乎是一种独立于我自己的代码的操作。哦,我现在明白您的意思了。有趣。您可能需要提交错误报告。