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

--yarn can not work correctly after 1.81.0 #494

Closed
YXL76 opened this issue Oct 2, 2020 · 13 comments
Closed

--yarn can not work correctly after 1.81.0 #494

YXL76 opened this issue Oct 2, 2020 · 13 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@YXL76
Copy link

YXL76 commented Oct 2, 2020

If project has yarn.lock file, vsce will use yarn automatically. However, when using --yarn flag, it will fall back to npm

@roydukkey
Copy link

I don't use yarn and I received the following error:

% vsce package            
Executing prepublish script 'yarn run vscode:prepublish'...
/bin/sh: yarn: command not found
 ERROR  yarn failed with exit code 127

These are the only packages I have globally:

% npm -g list --depth 0
/usr/local/lib
├── [email protected]
├── [email protected]
└── [email protected]

@marklawlor
Copy link

In addition to @roydukkey comments. A fresh project with no .yarnrc, yarn.lock or yarn executable installed is defaulting to yarn.

@ranavale
Copy link

ranavale commented Oct 3, 2020

  • Azure build pipeline was working fine with vscode build plugin step (using Executing prepublish script 'npm run vscode:prepublish'...)
  • I have not installed yarn neither my repo has anything related to yarn.
  • Since today afternoon, prepublish is using Executing prepublish script 'yarn run vscode:prepublish'... and failing with
'yarn' is not recognized as an internal or external command,
operable program or batch file.
 ERROR  yarn failed with exit code 1

@felipecrs
Copy link
Contributor

Does --no-yarn helps?

@ranavale
Copy link

ranavale commented Oct 3, 2020

@felipecrs It did not, as I am using azure build pipeline. rather I am not sure what changes/task I need to change in azure pipeline. My extension scripts are

    "scripts": {
        "vscode:prepublish": "npm run compile",
        "compile": "tsc -p ./",
        "watch": "tsc -watch -p ./",
        "test": "npm run compile && node ./node_modules/vscode/bin/test"
    },

@felipecrs
Copy link
Contributor

felipecrs commented Oct 3, 2020

I can confirm the bug, I tried to debug but I was not able to.

For users facing this issue, I recommend to downgrade vsce:

{
  "devDependencies": {
    "vsce": "1.80.0"
  }
}

@felipecrs
Copy link
Contributor

felipecrs commented Oct 3, 2020

Okay, I found the issue.

The commander always sets the yarn option to true by default, rather than undefined.

/cc @rbuckton @joaomoreno

@felipecrs
Copy link
Contributor

Submitted a PR. This behavior was fixed in commander 3.0.0.

@ranavale
Copy link

ranavale commented Oct 4, 2020

adding --no-yarn fixed the issue, but I think every user need to update their pipeline for this is not a good recommendation.

@felipecrs
Copy link
Contributor

adding --no-yarn fixed the issue, but I think every user need to update their pipeline for this is not a good recommendation.

For sure, it's not a solution, just a workaround until the issue gets fixed.

However, I believe the best workaround so far is to downgrade the vsce to 1.80.0.

@joaomoreno
Copy link
Member

Oof, sorry about that. Releasing a new version asap.

@joaomoreno joaomoreno self-assigned this Oct 5, 2020
@joaomoreno joaomoreno added this to the September 2020 milestone Oct 5, 2020
@joaomoreno joaomoreno added the bug Issue identified by VS Code Team member as probable bug label Oct 5, 2020
@joaomoreno
Copy link
Member

Sorry for the breakage everyone. v1.81.1 is cooking right now with the fix and should be out in a few minutes.

lhein added a commit to jboss-fuse/vscode-atlasmap that referenced this issue Oct 5, 2020
2 changes:
1. adapted the nodejs version to "nodejs-lts" which will use the latest LTS version configured in Jenkins
2. added parameter "--no-yarn" to the vsce call which enforces that yarn is NOT used (workaround for issue microsoft/vscode-vsce#494 introduced in vsce 1.81.0)
lhein added a commit to camel-tooling/camel-lsp-client-vscode that referenced this issue Oct 5, 2020
2 changes:
1. adapted the nodejs version to "nodejs-lts" which will use the latest LTS version configured in Jenkins
2. added parameter "--no-yarn" to the vsce call which enforces that yarn is NOT used (workaround for issue microsoft/vscode-vsce#494 introduced in vsce 1.81.0)
@ranavale
Copy link

ranavale commented Oct 5, 2020

Thank you very much. @felipecrs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants