Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jf yarn install - [🚨Error] invalid character 'u' looking for beginning of value #1166

Open
chkp-roniz opened this issue Apr 1, 2024 · 4 comments
Assignees

Comments

@chkp-roniz
Copy link

I am not using scopes in my yarn project (just npmRegistryServer); hence, this line fails since yarn config get npmScopes is
undefined

err = json.Unmarshal([]byte(npmScopesStr), &npmScopesMap)

Please skip if undefined and don't try to unmarshal it to JSON

@chkp-roniz
Copy link
Author

chkp-roniz commented Apr 1, 2024

Also, after setting an internal scope in npmScopes, jf yarn install freezes for a long time

# yarn config get npmScopes
{
  internal: {
    npmAlwaysAuth: false,
    npmAuthIdent: null,
    npmAuthToken: null,
    npmAuditRegistry: null,
    npmPublishRegistry: null,
    npmRegistryServer: 'https://artifactory.company.com/artifactory/api/npm/npm/'
  }
}

# jf yarn install
10:45:41 [Debug] JFrog CLI version: 2.52.9
10:45:41 [Debug] OS/Arch: linux/amd64
10:45:41 [🔵Info] Running Yarn...
10:45:41 [Debug] Preparing to read the config file /repo/.jfrog/projects/yarn.yaml
10:45:41 [Debug] Found resolver in the config file /repo/.jfrog/projects/yarn.yaml
10:45:41 [Debug] Preparing prerequisites.
10:45:41 [Debug] Found Yarn executable at: /usr/local/bin/yarn
10:45:41 [Debug] Working directory set to: /repo
10:45:41 [Debug] Found Yarn executable at: /usr/local/bin/yarn
10:45:42 [Debug] Sending HTTP GET request to: https://artifactory.company.com/artifactory/api/system/version
10:45:42 [Debug] Artifactory response: 200 OK
10:45:42 [Debug] JFrog Artifactory version is: 7.71.11
10:45:42 [Debug] Sending npm auth request
10:45:42 [Debug] Sending HTTP GET request to: https://artifactory.company.com/artifactory/api/npm/auth
10:45:42 [Debug] Sending HTTP GET request to: https://artifactory.company.com/artifactory/api/repositories/npm
10:45:42 [Debug] The file /repo/.yarnrc.yml was backed up successfully to jfrog.yarnrc.backup

@EyalDelarea
Copy link
Contributor

Hey @chkp-roniz,

Could you please provide more details to assist us in resolving the issue?

Which version of Yarn are you using?
Could you please provide detailed steps to reproduce the problem?

Your input will greatly aid us in addressing this matter effectively.

@EyalDelarea EyalDelarea self-assigned this Apr 14, 2024
@chkp-roniz
Copy link
Author

docker run -it artifactory.company.com/docker/node:latest /bin/bash

# node --version
v20.5.0

# yarn set version stable
➤ YN0000: You don't seem to have Corepack enabled; we'll have to rely on yarnPath instead
➤ YN0000: Downloading https://repo.yarnpkg.com/4.1.1/packages/yarnpkg-cli/bin/yarn.js
➤ YN0000: Saving the new release in .yarn/releases/yarn-4.1.1.cjs
➤ YN0000: Done with warnings in 0s 288ms

# npm config set registry https://artifactory.company.com/artifactory/api/npm/npm/
# yarn config set npmRegistryServer https://artifactory.company.com/artifactory/api/npm/npm/

# <Install and config JF CLI>

# mkdir test && cd test && npm init...
/test# jf yarn install react
10:29:20 [🔵Info] Running Yarn...
10:29:21 [🚨Error] invalid character 'u' looking for beginning of value

@EyalDelarea
Copy link
Contributor

Hey @chkp-roniz,

I noticed that you're currently using yarn v4.1.1, but it seems that the JFrog CLI doesn't support yarn version 4.x yet. While changing the specific line you mentioned might prevent the CLI from crashing, it's just one of many changes from the previous versions to v4 that needs to be done.

My suggestion would be to downgrade yarn to v3.8.1 if possible. I've tested it with this version of yarn, and it works well. Additionally, you could open a feature request for yarn v4 support, and we'll consider incorporating it into our roadmap.

Let me know if you have any more questions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants