I am trying to create npm vue component library
. I have been working through all the steps but stuck at npm publish
.
Please see the below error screenshot for which I am unable to find a solution on google after trying more than an hour(The error message is not that accurate IMHO or maybe I am not able to catch it).
For reference 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"
}
}
After running npm audit
Any help will be appreciated :)
This post has helped me moving past the 403 error, however, after confirming my account over the email link they send and after login into NPM I tried one more time, then I got the following error:
402 Payment Required - PUT https://registry.npmjs.org/@jcarbajal79%2fsimplelib3 - You must sign up for private packages.
If you have the same problem is because the library is being published as private, I checked my package.json and test the following:
No property: "private":"...". - does not work Property set "private":"true" - does not work Property set "private":"false" - does not work
Turns out you have to publish it as public from the command line:
%> npm publish --access=public. - Works!.
Update: New user needs to confirm their account first
So after quite a few research and digging around, I found the real issue here.
It's probably documented somewhere very deep or in a light font, but I totally missed to find it.
Your package name should follow your npm username
.
In my package.json
name property is @satyam/vue-components
where it should be @satyamninja/vue-components
and that's it. I successfully published the package.
If you are a new user, please confirm your account first!
It sound like you are a new user. You need to confirm your account. Should have get email confirmation from npm site.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With