NPM Authentication with scopes?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

NPM Authentication with scopes?

webdevwilson
I have an instance of Artifactory that I have setup with an npm repository. I have used the instructions to setup my ~/.npmrc. I feel like it is correct, but just in case, here it is:

@myscope:registry=https://myinstance.artifactoryonline.com/myinstance/api/npm/npm

//myinstance.artifactoryonline.com/myinstance/api/npm/npm/:_password=<mypassword>

//myinstance.artifactoryonline.com/myinstance/api/npm/npm/:username=<username>

//myinstance.artifactoryonline.com/myinstance/api/npm/npm/:email=<my email>

//myinstance.artifactoryonline.com/myinstance/api/npm/npm/:always-auth=true

when I try to npm publish on an npm with @myscope/name I npm (2.14.12) gives me:

Error: auth required for publishing

The server never receives a request. Has anyone experienced this?

kw



------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Artifactory-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/artifactory-users
Reply | Threaded
Open this post in threaded view
|

Re: NPM Authentication with scopes?

uriahl
Hi Kerry,

There could be several reason for this type of failure. We'll need some more information in order to help you here. If you can send the below information, that'll help:

1.Your package.json file
2.Rerun the npm publish command, but add the --verbose flag. Please send us the full output in a text file.
3.Your request.log and artifactory.log files - you can retrieve it via the Artifactory UI -> Admin -> System Logs (under Advanced), after having reproduced the issue.

Cheers,
-Uriah
Reply | Threaded
Open this post in threaded view
|

Re: NPM Authentication with scopes?

webdevwilson
I figured it out and updated this ticketĀ 


kw

On Wed, Feb 3, 2016 at 4:22 PM uriahl <[hidden email]> wrote:
Hi Kerry,

There could be several reason for this type of failure. We'll need some more
information in order to help you here. If you can send the below
information, that'll help:

1.Your package.json file
2.Rerun the npm publish command, but add the --verbose flag. Please send us
the full output in a text file.
3.Your request.log and artifactory.log files - you can retrieve it via the
Artifactory UI -> Admin -> System Logs (under Advanced), *after having
reproduced the issue*.

Cheers,
-Uriah




--
View this message in context: http://forums.jfrog.org/NPM-Authentication-with-scopes-tp7580788p7580793.html
Sent from the Artifactory - Users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Artifactory-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/artifactory-users

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Artifactory-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/artifactory-users
Reply | Threaded
Open this post in threaded view
|

Re: NPM Authentication with scopes?

Astrien
This post has NOT been accepted by the mailing list yet.
In reply to this post by uriahl
I'm having the same problem and none of the suggestions are working for me.  I have admin to our Artifactory instance and have created the npm-local, npm-remote, and then the npm-virtual repositories.  I got publish to work for a non-scoped package, but as soon as I changed to scoped, I could only get a 405 or auth error, depending on who's suggestion I tried.

Details are below.  Can anyone tell me what I'm doing wrong?

For the scoped publish:

1. Executed:

curl -i -u<USERNAME>:<PASSWORD> https://artifactory.io.comcast.net/api/npm/auth
curl -i -u<USERNAME>:<PASSWORD> "https://artifactory.io.comcast.net/api/npm/npm-local/auth/comcast"

2. Used exact output to create my .npmrc file (changed personal info):
------------------------------
registry=https://artifactory.io.comcast.net/api/npm/npm-all
@comcast:registry=https://artifactory.io.comcast.net/api/npm/npm-local/
//artifactory.io.comcast.net/api/npm/npm-local/:_password=[password]
//artifactory.io.comcast.net/api/npm/npm-local/:username=[username]
//artifactory.io.comcast.net/api/npm/npm-local/:email=[email]
//artifactory.io.comcast.net/api/npm/npm-local/:always-auth=true
_auth = [authString]
always-auth = true
email = [email]
strict-ssl=false
------------------------------

3. Created fake package.json:
------------------------------
{
  "name": "@comcast/npm-test",
  "version": "1.0.1",
  "description": "A package used to test artifactory publishing.",
  "main": "index.js",
  "scripts": {
    "test": "test"
  },
  "author": "John O'Grady",
  "license": "ISC",
  "publishConfig": {
    "registry": "https://artifactory.io.comcast.net/api/npm/npm-local"
  },
  "dependencies": {
    "superagent": "^1.8.3"
  }
}
------------------------------
4. Executed "npm publish" in directory with the package.json

5. Received error message:
------------------------------
C:\Dev\_projects\_skunky\npm-test>npm publish
npm ERR! publish Failed PUT 405
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Dev\\nodejs\\node.exe" "C:\\Dev\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "publish"
npm ERR! node v5.9.0
npm ERR! npm  v3.7.3
npm ERR! code E405

npm ERR! Registry returned 405 for PUT on https://artifactory.io.comcast.net/api/npm/npm-local/@comcast%2fnpm-test
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!     C:\Dev\_projects\_skunky\npm-test\npm-debug.log
------------------------------

6. Attached the debug log here:
npm-debug.log