Setting up npm
To do the setting up:
-
For all projects: run this command:
npm config set registry https://registry.yandexcloud.net/npm/<registry_ID>
-
For one project:
-
Open the
.npmrc
file in the project root. -
Depending on the authentication method:
IAM token (Base64)IAM_tokenOAuth token (Base64)-
Get an IAM token for the Yandex account or service account you are going to use for authentication.
-
Add the following lines to the previously created
.npmrc
file:registry=https://registry.yandexcloud.net/npm/<registry_ID> //registry.yandexcloud.net/npm/:_auth=${NPM_AUTH} always-auth=true
-
Create the
NPM_AUTH
environment variable containing the Base64-encodediam:<IAM_token>
line:export NPM_AUTH=$(echo -n 'iam:<IAM_token>' | base64)
Where
<IAM_token>
is the IAM token you got earlier.
-
Get an IAM token for the Yandex account or service account you are going to use for authentication.
-
Add the following lines to the previously created
.npmrc
file:registry=https://registry.yandexcloud.net/npm/<registry_ID> //registry.yandexcloud.net/npm/:_authToken=${NPM_AUTH_TOKEN} always-auth=true
-
Create the
NPM_AUTH_TOKEN
environment variable containing the previously obtained IAM token:export NPM_AUTH_TOKEN="<IAM_token>"
-
Get
an OAuth token for the Yandex account you are going to use for authentication. -
Add the following lines to the previously created
.npmrc
file:registry=https://registry.yandexcloud.net/npm/<registry_ID> //registry.yandexcloud.net/npm/:_auth=${NPM_AUTH} always-auth=true
-
Create the
NPM_AUTH
environment variable containing the Base64-encodedoauth:<OAuth_token>
line:export NPM_AUTH=$(echo -n 'oauth:<OAuth token>' | base64)
Where
<OAuth_token>
is the OAuth token you got earlier.
-
-