valapi / node-valapi

Valorant API wrapper for nodejs
https://valapi.github.io
MIT License
18 stars 7 forks source link

Dependency error: @valapi/* packages #4

Closed Drysque closed 2 years ago

Drysque commented 2 years ago

Hey! I'm interested in this package because it says it supports MFA

I tried the following command

yarn add @ing3kth/val-api

Which yielded this error:

error Couldn't find package "@valapi/api-wrapper@latest" required by "@ing3kth/val-api" on the "npm" registry.

followed by these errors:

Error: Couldn't find package "@valapi/riot-api@latest" required by "@ing3kth/val-api" on the "npm" registry.
Error: Couldn't find package "@valapi/lib@latest" required by "@ing3kth/val-api" on the "npm" registry.
Error: Couldn't find package "@valapi/riot-client@latest" required by "@ing3kth/val-api" on the "npm" registry.
Error: Couldn't find package "@valapi/valorant-api.com@latest" required by "@ing3kth/val-api" on the "npm" registry.

Also, when I try to visit the npm/package page, I get redirected to the login page, has if I didn't have permissions. Are the packages private ?

KTNG-3 commented 2 years ago

I just publish all packages on Github

yarn --registry https://npm.pkg.github.com

or just use npm

npm --registry https://npm.pkg.github.com

IDK it works or not but try first and reply to me Thank for the report!

Drysque commented 2 years ago

With the --registry https://npm.pkg.github.com, yarn correctly finds the @valapi/* dependencies!

But now it cannot find the main package

yarn --registry https://npm.pkg.github.com add @ing3kth/val-api
error Couldn't find package "@ing3kth/val-api" on the "npm" registry.
KTNG-3 commented 2 years ago

.npmrc

create .npmrc Example

registry

then put this text to .npmrc Example

@ing3kth:registry=https://registry.npmjs.org
@valapi:registry=https://npm.pkg.github.com

config

or run this command before install

npm config set "@valapi:registry"="https://npm.pkg.github.com/"
Drysque commented 2 years ago

Ok I'll try this

But I'm wondering, isn't this supposed to be done by you in the KTNG-3/valorant-api/.npmrc, so that anyone that wants to use your project can do it right away without looking for this issue?

KTNG-3 commented 2 years ago

probably yes, I just want to try

Drysque commented 2 years ago

What my project looks like

.
├── src/
├── node_modules/
├── package.json
├── .npmrc
└── yarn.lock

.npmrc

@ing3kth:registry=https://registry.npmjs.org
@valapi:registry=https://npm.pkg.github.com

manually set yarn config

~ yarn config set "@valapi:registry" "https://npm.pkg.github.com/"
yarn config v1.22.17
success Set "@valapi:registry" to "https://npm.pkg.github.com/".
~ yarn config set "@ing3kth:registry" "https://registry.npmjs.org"
yarn config v1.22.17
success Set "@ing3kth:registry" to "https://registry.npmjs.org".

result of yarn config

~ yarn config list
yarn config v1.22.17
info yarn config
{
  ...
  '@ing3kth:registry': 'https://registry.npmjs.org',
  '@valapi:registry': 'https://npm.pkg.github.com/'
}
info npm config
{
  '@ing3kth:registry': 'https://registry.npmjs.org',
  '@valapi:registry': 'https://npm.pkg.github.com'
}

install

~ yarn add @ing3kth/val-api
error Couldn't find package "@valapi/api-wrapper" on the "npm" registry.
Error: Couldn't find package "@valapi/lib" on the "npm" registry.
Error: Couldn't find package "@valapi/riot-client" on the "npm" registry.
Error: Couldn't find package "@valapi/riot-api" on the "npm" registry.
Error: Couldn't find package "@valapi/valorant-api.com" on the "npm" registry.
Drysque commented 2 years ago

With npm

~ npm config set "@valapi:registry"="https://npm.pkg.github.com/"
~ npm config list
; "user" config from /root/.npmrc

; @valapi:registry = "https://npm.pkg.github.com/" ; overridden by project

; "project" config from /app/.npmrc

@ing3kth:registry = "https://registry.npmjs.org" 
@valapi:registry = "https://npm.pkg.github.com" 

; node bin location = /usr/local/bin/node
; cwd = /app
; HOME = /root
; Run `npm config ls -l` to show all defaults.
~ npm install @ing3kth/val-api
npm ERR! code E401
npm ERR! Incorrect or missing password.
npm ERR! If you were trying to login, change your password, create an
npm ERR! authentication token or enable two-factor authentication then
npm ERR! that means you likely typed your password in incorrectly.
npm ERR! Please try again, or recover your password at:
npm ERR!     https://www.npmjs.com/forgot
npm ERR! 
npm ERR! If you were doing some other operation then your saved credentials are
npm ERR! probably out of date. To correct this please try logging in again with:
npm ERR!     npm login
KTNG-3 commented 2 years ago

I find a problem when going to npm.pkg.github.com it says you need to login to GitHub first IDK why but I change all package paths to NPM.

so delete all hard work and use the default.

Drysque commented 2 years ago

Haha ok, thank you for trying, i'll retry with the default way when you push. Then, i'll close the issue if it works.

Drysque commented 2 years ago

A simple yarn add @ing3kth/val-api does the trick now ! Sorry for the trouble

KTNG-3 commented 2 years ago

NP