美文网首页NodeJS
Nodejs 常见问题

Nodejs 常见问题

作者: zyqcoder | 来源:发表于2019-03-14 17:20 被阅读0次
    npm ERR! Unable to authenticate, need: Basic
    

    原因是:名字已被注册

    Registry returned 400 for PUT on http://registry.npmjs.org/-/user/org.couchdb.user:zyqcoder: The password you have entered was detected on a public list of known compromised passwords. Please enter a different password.
    

    原因是:密码有问题,设置一个没有用过的密码

    
    username:zyqcoder
    
    password:#123456
    
    

    npm publish . 出现以下错误

    You do not have permission to publish "sayhello". Are you logged in as the correct user? : sayhello
    

    原因是:package.json 里面的name已被发布过,换一个没发布过的

    npm ERR! publish Failed PUT 402npm ERR! code E402npm ERR! You must sign up for private packages : @zyqcoder/sayhellotest
    

    原因是:npm publish --access=public

    # 发布成功后可以用以下命令进行安装
    npm install @zyqcoder/sayhellotest --registry=http://registry.npmjs.org
    
    # 查看谁有权限发布包
    npm owner ls @zyqcoder/sayhellotest
    
    # 添加删除拥有者
    npm owner add <user> <package name>
    nom owner rm <user> <package name>
    
    mocha test/graphql/
    /Users/amy/Documents/Workspace/code/nodejs/classroom/classroom-api-graphql/app.js:1
    (function (exports, require, module, __filename, __dirname) { import koaSpeed from 'koa-speed'
                                                                         ^^^^^^^^
    
    SyntaxError: Unexpected identifier
    

    出现以上错误是因为不支持es6 新语法 import

    解决方案:

    mocha test/graphql/ -r esm
    

    相关文章

      网友评论

        本文标题:Nodejs 常见问题

        本文链接:https://www.haomeiwen.com/subject/aoycmqtx.html