Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why I am unable to publish my package to npmjs

I have created an account with npmjs.com also I'm following the how-to-npm tutorial from command line (linux). I'm at the stage where I should publish my test module. But I keep getting error:

You must sign up for private packages : @zentech/node

these are all the error when npm publish

npm ERR! publish Failed PUT 402
npm ERR! Linux 4.10.0-33-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "publish"
npm ERR! node v4.7.2
npm ERR! npm  v3.5.2
npm ERR! code E402

npm ERR! You must sign up for private packages : @zentech/node
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /home/george/node/npm-debug.log

my package.json file

{
  "name": "@zentech/node",
  "version": "1.0.1",
  "main": "index.js",
  "preferGlobal": true,
  "scripts": {
    "test": "node test.js"
  },
  "author": "",
  "license": "ISC",
  "description": "",
  "repository": "http://github.com/zentech/node"
}

does anyone know why the error? thanks

like image 517
miatech Avatar asked Nov 28 '22 00:11

miatech


1 Answers

As suggested in the comments above the way to publish a scoped package i.e.

@scope/my-package

is to use the --access flag when publishing

npm publish --access=public

You do not need to sign up for private packages unless you actually want your package to be private.

like image 159
Zaptree Avatar answered Dec 04 '22 03:12

Zaptree