我正在努力创造npm vue component library个.我已经完成了所有的步骤,但仍停留在npm publish步.

请看下面的错误截图,在try 了一个多小时后,我在谷歌上找不到解决方案(错误信息不是那么准确,或者我可能无法捕捉到).

enter image description here

参考package.json

{
  "name": "@satyam/vue-components",
  "version": "0.1.0",
  "main": "./dist/satyam.common.js",
  "files": [
    "dist"
  ],
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "build-library": "vue-cli-service build --target lib --name satyam ./src/components/index.js",
    "test:unit": "vue-cli-service test:unit",
    "lint": "vue-cli-service lint"
  },
  "dependencies": {
    "core-js": "^3.6.4",
    "vue": "^2.6.11"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "~4.3.0",
    "@vue/cli-plugin-eslint": "~4.3.0",
    "@vue/cli-plugin-unit-jest": "~4.3.0",
    "@vue/cli-service": "~4.3.0",
    "@vue/eslint-config-standard": "^5.1.2",
    "@vue/test-utils": "1.0.0-beta.31",
    "babel-eslint": "^10.1.0",
    "eslint": "^6.7.2",
    "eslint-plugin-import": "^2.20.2",
    "eslint-plugin-node": "^11.1.0",
    "eslint-plugin-promise": "^4.2.1",
    "eslint-plugin-standard": "^4.0.0",
    "eslint-plugin-vue": "^6.2.2",
    "node-sass": "^4.12.0",
    "sass-loader": "^8.0.2",
    "vue-template-compiler": "^2.6.11"
  }
}

跑完npm audit

enter image description here

任何帮助都将不胜感激:)

推荐答案

Update: New user needs to confirm their account first

因此,经过大量的研究和挖掘,我发现了真正的问题.

它可能被记录在某个很深的地方,或者用浅色字体,但我完全没有找到它.

你的包裹名称应该跟在你的npm username后面.

在我的package.json个名字中,属性是@satyam/vue-components,应该是@satyamninja/vue-components,就这样.我成功地发布了这个包.

Vue.js相关问答推荐

保持页面重新加载之间的状态

Vue 3 在一个值更改问题后再次重新渲染每一行

Vue 3 如何通过多个组件传递插槽

Vue 脚本标签中更漂亮的 destruct 功能

Nuxt 2.15.7 的构建错误 - 无法解析 CSS @font-face URL

如何 for each 用户分组聊天消息?

Vuetify Datatable - 在所有列上启用内容编辑

判断 vue-router.beforeEach 不限制对路由的访问

未捕获的类型错误:无法读取未定义的属性initializeApp

如何在 vue.js 中包含当年的版权?

更新 vue.js 中的数据属性/对象

如何在 vue 3 中获取路由的参数?

异步方法不等待函数

如何将 Angular 和 Vue 项目合并在一起?

Vue组件未在laravel 5.3中使用Passport 显示

未在实例上定义,但在渲染期间引用

更改事件上的 Select2 在 Vuejs 中不起作用

Vuetify 过渡:如何设置过渡速度

带有 Firebase 云消息传递的 Vue pwa 无法正常工作

如何在 vue3 中的setup方法中发出事件?