verdaccio報錯500及403問題筆記

verdaccio 報錯 Error: internal server error : -/user/org.couchdb.user: xxx

安裝完成verdaccio後,在命令行中執行添加用戶,無法正常添加

ps:
首先使用nrm add myResp <htpp://127.0.0.1:4873>
然後切換源nrm use myResp

添加用戶操作

$ npm adduser
Username: bingxx
Password: bingxx
Email: (this IS public)

命令行一直停在Email這裏很久,然後報錯500,主要錯誤如下
Error: internal server error : -/user/org.couchdb.user: xxx

這個問題應該是verdaccio沒有權限訪問文件目錄,給相應在權限即可解決

verdaccio 報錯 error publish Failed PUT 403

verdaccio安裝成功,給了verdaccio讀寫權限後,可正常使用npm adduser 創建用戶,但是無法正常發佈項目,使用如下命令發佈項目

npm publish

這時報錯error publish Failed PUT 403,主要問題是用戶沒有權限發佈項目,這時需要修改配置文件。
配置文件的地址在啓動項目時,會顯示當前的配置文件地址config.yaml,打開配置文件,修改packages
項,指定路徑在訪問權限

uplinks:
  npmjs:
    url: https://registry.npmjs.org/
packages:
  '@*/*':
    # scoped packages
    access: $all
    publish: $authenticated
    unpublish: $authenticated
    proxy: npmjs
  '**':
    # allow all users (including non-authenticated users) to read and
    # publish all packages
    #
    # you can specify usernames/groupnames (depending on your auth plugin)
    # and three keywords: "$all", "$anonymous", "$authenticated"
    access: $all
    # allow all known users to publish/publish packages
    # (anyone can register by default, remember?)
    publish: $authenticated
    unpublish: $authenticated
    # if package is not available locally, proxy requests to 'npmjs' registry
    proxy: npmjs
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章