我制作了第一个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>
我做错了什么?
我认为我的代码与&#34; adduser&#34;无关。操作,但无论如何,这里是代码:https://github.com/enriquemorenotent/grunt-ini-file
答案 0 :(得分:2)
这是npm的一个已知错误:https://github.com/npm/npm/issues/4363
使用:npm install npm -g
然后删除您的~/.npmrc
文件。最后再次运行npm adduser
命令。