NAATL
NAATL

Reputation: 1

Publishing Private NPM Package to Gitlab

I'm facing issues publishing my Node.js package to npm from a GitLab repository.

Imagine that I have a GitLab repository, here it is: https://gitlab.company.fr/dtc/front/poc2/shared_library. So, I've created my shared library repo and cloned it to my local machine. Now, I've run npm init, and my package.json looks like this:

{
"name": "@dtc/shared-library",
"version": "2.0.0",
"description": "To make it easy for you to get started with GitLab, here's a list of recommended next steps.",
"main": "index.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1"
},
"files": \[
"index.js"
\],
"repository": {
"type": "git",
"url": "[email protected]/dgc/dtc/front/shared_library.git"
},
"author": "",
"license": "ISC",
"publishConfig": {
"@dtc:registry": "https://gitlab.company.fr/dtc/front/poc2/60/packages/npm/"

}
}

And my .npmrc file looks like

this:`registry=https://gitlab.company.fr/dtc/front/poc2/60/packages/npm/
//gitlab.company.fr/dtc/front/poc2/60/packages/npm/:_authToken=test-52Sx6zn9mgsC5_XTh7bK%60


I generated an authentication token by going to "repository" and then "token." However, when I run npm publish, I get this error:

*npm ERR! code ENEEDAUTH npm ERR! need auth This command requires you to be logged in to https://gitlab.company.fr/dtc/front/poc2/60/packages/npm/ npm ERR! need auth You need to authorize this machine using `npm adduser`

And when I run npm login and enter the correct credentials, I get this error:

*npm ERR! code E404 npm ERR! 404 Not Found - PUT https://gitlab.company.fr/-/user/org.couchdb.user:myUsername* 

Upvotes: 0

Views: 108

Answers (0)

Related Questions