Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a35c2989
Commit
a35c2989
authored
Apr 23, 2021
by
Kate Grechishkina
Committed by
Nick Gaskill
Apr 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document how to use GitLab registry with yarn v2
parent
b7df212d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
1 deletion
+41
-1
doc/user/packages/npm_registry/index.md
doc/user/packages/npm_registry/index.md
+41
-1
No files found.
doc/user/packages/npm_registry/index.md
View file @
a35c2989
...
...
@@ -43,7 +43,7 @@ The npm version is shown in the output:
### Install Yarn
As an alternative to npm, you can install Yarn in your local environment by following the
instructions at
[
yarnpkg.com
](
https://classic.yarnpkg.com/en/docs/install
)
.
instructions at
[
classic.
yarnpkg.com
](
https://classic.yarnpkg.com/en/docs/install
)
.
When installation is complete, verify you can use Yarn in your terminal by
running:
...
...
@@ -305,6 +305,46 @@ See the
[
Publish npm packages to the GitLab Package Registry using semantic-release
](
../../../ci/examples/semantic-release.md
)
step-by-step guide and demo project for a complete example.
## Configure the GitLab npm registry with Yarn 2
You can get started with Yarn 2 by following the documentation at
[
https://yarnpkg.com/getting-started/install
](
https://yarnpkg.com/getting-started/install
)
.
To publish and install with the project-level npm endpoint, set the following configuration in
`.yarnrc.yml`
:
```
yaml
npmScopes
:
foo
:
npmRegistryServer
:
"
https://gitlab.example.com/api/v4/projects/<your_project_id>/packages/npm/"
npmPublishRegistry
:
"
https://gitlab.example.com/api/v4/projects/<your_project_id>/packages/npm/"
npmRegistries
:
//gitlab.example.com/api/v4/projects/<your_project_id>/packages/npm/
:
npmAlwaysAuth
:
true
npmAuthToken
:
"
<your_token>"
```
For the instance-level npm endpoint, use this Yarn 2 configuration in
`.yarnrc.yml`
:
```
yaml
npmScopes
:
foo
:
npmRegistryServer
:
"
https://gitlab.example.com/api/v4/packages/npm/"
npmRegistries
:
//gitlab.example.com/api/v4/packages/npm/
:
npmAlwaysAuth
:
true
npmAuthToken
:
"
<your_token>"
```
In this configuration:
-
Replace
`<your_token>`
with your personal access token or deploy token.
-
Replace
`<your_project_id>`
with your project's ID, which you can find on the project's home page.
-
Replace
`gitlab.example.com`
with your domain name.
-
Your scope is
`foo`
, without
`@`
.
## Publishing packages with the same name or version
You cannot publish a package if a package of the same name and version already exists.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment