Getting Error 402 while publishing package using npm - node.js

I am using npm version 2.15.11 and node version 4.7.2 on ubuntu 14.04. I want to publish my packages. when i use the command:
npm publish
i am geting the error: You need a paid account to perform this action. For more info, visit: https://www.npmjs.com/private-modules
Below is the screenshot of error:
Please provide me the solution to overcome this issue. Thanks in advance.

Run
npm publish --access=public
the first time you publish a scoped package.
The default access setting is private, but for this you need a paid account. Hence the error message.

In addition to the command line option provided by bersling, you can merge the following into your package.json:
{
"publishConfig": {
"access": "public"
}
}
Reference in npm documentation. Useful when you want to template it into your package manifests and not think about it.
P.S. had one of those old OpenId accounts, forgot to update it before it was nuked, no longer have the ability to add this as a comment to bersling's reply, which is where I feel this really belongs.

In package.json, npm version 6+ you have this option:
"private": true/false,
Be sure is false, and also try to use this flag:
npm publish --access=public

you probably initialized your package with a scope so that it is private. Read
https://docs.npmjs.com/private-modules/intro

Just want to add that, if you tried all the other answers and still get this error, someone(maybe yourself) could have somehow changed the package to private previously, in which case, you need to set the package to public before you could publish again... Orz

Related

Fork node_module react and install not working

I tried to fork this react native module to make some corrections, because the author abandoned the project and he was the only tool I found and meets my need, so reading an article I found out about the fork, I did this procedure, then I cloned and did necessary correction, only when having to add the module to my react project with the
yarn add lucassouza16/react-native-svg-uri
I get this error:
error Couldn't find the binary git
I'm new to this forking function, is there anything else I need to do?
My bifurcated repository:
https://github.com/lucassouza16/react-native-svg-uri
Original repository:
https://github.com/vault-development/react-native-svg-uri
To add it via npm or yarn you will need to add this firstly to npm registry. Here you have more information about it https://docs.npmjs.com/packages-and-modules/contributing-packages-to-the-registry
You can also add via github doing like this:
yarn add git+https://github.com/lucassouza16/react-native-svg-uri.git
You can read more about it here:
How to install an npm package from GitHub directly?
In the end all responses resulted in the same error, yet thanks to everyone who tried to help me, but it worked when I added the release version, this is the correct format:
yarn add lucassouza16/react-native-svg-uri#1.2 .4

Azure Pipeline - npm install error 403 with Azure Feed

My NPM install step is configured to use registries in .npmrc,
My .npmrc is as follows
registry=https://pkgs.dev.azure.com/xxx/xxxx-xxxx-xxxx/_packaging/design-system/npm/registry/
always-auth=true
The Azure Artifacts feed is set-up, and a local npm install from my dev machine works completely fine.
However the pipeline's npm install job always fails with error 403.
What am I doing wrong here? I've also tried changing the npm install task to use Registry I select here, and linking it to my "design-system" feed directly, but it results in the same error. I've followed all the steps here https://learn.microsoft.com/en-us/azure/devops/artifacts/npm/npmrc?view=azure-devops&tabs=windows, but it just doesn't work. Thanks
Problem solved. What I had to do was go under into the feed -> settings -> permissions, and add the ...Build Service... as a Contributor.
Microsoft should really add this as part of their documentation. Took me several hours of random attempts before I found it..
This is a different solution for the same message, although, in this case it will fail from any location.
Trying to publish a package version previous to the last one published on the feed will return the 403 Forbidden error to, even if it's not a permissions issue.
Updating the package version to one increment after the current version will solve the problem.

How do you use tfs-cli in a disabled network environment?

Our TFS build server does not have access to the internet. After getting node.js installed next I tried to install tfx-cli. using the command:
npm install -g tfx-cli
As far as I can tell, now it wants to download dependencies required. It looks like a whole web of dependencies - nuget style. Am I expected to set up an internal npm server with the dozens of dependencies required, becoming an expert on node.js and npm - just so I can add some custom commands to our TFS server?
Is there a version of tfs-cli I can get that includes all dependencies ?
I know this is old, but I just happened to come across your question. Hopefully this will help others.
Although I haven't tried it myself, there do seem to be ways of installing NPM packages offline. Here's one Stack Overflow answer that may get you pointed in the right direction. Another solution I've seen recommended is npmbox.

Where did node-awssum go?

I'm using a Node.js library called node-awssum which has been around for quite some time. But now it seems that the library has been taken down from Github. Does anyone know what happened to it and where I can find a replacement repository or a fork?
https://github.com/appsattic/node-awssum
https://www.google.com/search?q=node+awssum
Note: I'm the author of AwsSum.
AwsSum now has a new plugin architecture and it also now has a GitHub organisation:
https://github.com/awssum/awssum
The package currently on NPM is 1.0.0-alpha so if you want the old version, you should explicitly state that you want v0.12.2 in your package.json file.
In the new way of doing things, if you are only using S3, then you'd just put awssum-amazon-s3 in your package.json and awssum and awssum-amazon will be pulled in as peerDependencies.
Also note that the http://awssum.io/ site is still there but needs updating.
Finally, if you want to find plugins for AwsSum, do this to find what's available:
$ npm search awssum-plugin
Cheers,
Andy
You mean awssum, node-awssum has been discontinued. See here :
Github link
npm link

Issue in installing twilio module

I am trying to install twilio for nodejs. These lines are coming up in console.
npm WARN twilio#0.4.0 package.json: 'modules' object is deprecated
twilio#0.4.0 ./node_modules/twilio
How to get rid of this ?
I am using npm install twilio command.
I tried to download and copied in node_modules folder but that is not working.
This has to do with the package.json file which is a specially formatted file used for the npm package management system. Certain values are required and some of those key names have changed over the years and some just have been removed. The error you are getting is due to the package.json file still using the modules key:
},
"modules": {
"client": "./lib/twilio",
"twiml": "./lib/twiml"
},
https://github.com/sjwalter/node-twilio/blob/master/package.json#L13
Even though you are getting this error it should not effect your usage of the module. It was still installed and everything should work just fine.
There's an open bug report for this, but it doesn't seem to have gotten much attention.

Resources