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

All npm run <command> fails on GitLens v9.4.1 source code on macOS Mojave #644

Closed
billsedison opened this issue Feb 4, 2019 · 17 comments
Closed

Comments

@billsedison
Copy link

billsedison commented Feb 4, 2019

  • GitLens Version: 9.4.1
  • VSCode Version: 1.30.2
  • OS Version: macOS Mojave 10.14.1
  • nodejs version: v10.14.2
  • npm version: v6.4.1

Steps to Reproduce:

  1. git clone https://github.com/eamodio/vscode-gitlens.git (master branch)
  2. cd vscode-gitlens
  3. npm i
  4. npm run build

You'll see no dist folder is generated. If you use VSCode to open it, and run F5, the extension is not runnable.

All npm run <command> fails.
The issue is the size of the package.json file. It is around 220KB.
On removing some fields to reduce the file size, npm run commands work fine.

@eamodio eamodio added the needs-more-info Needs further information, steps, details, etc. label Feb 5, 2019
@eamodio
Copy link
Member

eamodio commented Feb 5, 2019

@billsedison What is the output from the commands?

@billsedison
Copy link
Author

@eamodio There is not specific output, npm run build only exists silently.

$ npm run build

> gitlens@9.4.1 build /Users/honghaowang/Workspace/topcoder/copiloting/Aggregated_Git_Diff_For_VS_Code/9.4.1/vscode-gitlens
> webpack --env.development

$

Here is a screencast
output

This is only observed on macOS, no such issue on Ubuntu 18.04 and Windows 10.

@eamodio
Copy link
Member

eamodio commented Feb 6, 2019

@billsedison Could this be related: https://stackoverflow.com/questions/53602337/node-and-npm-too-slow-to-start-after-install-of-macos-mojave

If you wait a while does it actually start?

@eamodio
Copy link
Member

eamodio commented Feb 6, 2019

From the output -- it looks like its trying to run the command. I'm at a loss. I would recommend reaching out to npm and ask them or dig into npm's trace logs.

@billsedison
Copy link
Author

Could this be related: https://stackoverflow.com/questions/53602337/node-and-npm-too-slow-to-start-after-install-of-macos-mojave

If you wait a while does it actually start?

Nope, it never actually starts even I wait for 1 minute.

From the output -- it looks like its trying to run the command. I'm at a loss. I would recommend reaching out to npm and ask them or dig into npm's trace logs.

The problem is the package.json size (221KB) is too big, this issue wasn't observed on GitLens v8.5.6, where the package.json size is 159KB. Looks like the JSON object in package.json is too big.

If I reduce the size of package.json, for example, by removing contributes.configuration, then npm run build works.

Is it possible to move some configurations outside of package.json?

@eamodio
Copy link
Member

eamodio commented Feb 6, 2019

Again, I would still recommend reaching out / filling an issue with npm. npm deals with this fine on other OS' (and later versions of macOS I believe) and package-lock.json files are much larger.

As for breaking it up -- I would think it is possible with some sort of build step to put the files back together, but given what would be built would be package.json and that's what's used to run commands, etc -- it seems like it would be tricky at the least.

@billsedison
Copy link
Author

Okay, noted. Thanks.

@eamodio
Copy link
Member

eamodio commented Feb 6, 2019

Sorry I don't have anything better to offer -- I'm at a loss. 😢

@billsedison
Copy link
Author

billsedison commented Feb 6, 2019

No problem at all, thank you. At least I have some tricky workaround to bypass it by reducing the package.json size for now, it's been enough for my local development. 😄

@eamodio
Copy link
Member

eamodio commented Feb 6, 2019

👍 Can also just use webpack directly -- the npm scripts themselves aren't really tricky at all.

@billsedison
Copy link
Author

Yes, exactly!

@eamodio eamodio added blocked: vscode Caused by or dependent on a VS Code issue or feature blocked Blocked or caused by an upstream issue or feature and removed needs-more-info Needs further information, steps, details, etc. labels Feb 18, 2019
@eamodio
Copy link
Member

eamodio commented Feb 18, 2019

Going to close this since there isn't much I can do here given the package.json structure vscode requires.

@eamodio eamodio closed this as completed Feb 18, 2019
@kburson
Copy link

kburson commented Mar 2, 2019

can you use nps?

https://www.npmjs.com/package/nps

edit package.json:

"scripts": {
...,
"start": "nps"
}

Then create a package.scripts.js file for the build targets?

eamodio added a commit that referenced this issue Jul 19, 2019
@eamodio
Copy link
Member

eamodio commented Jul 19, 2019

I've just switched to yarn rather than npm and hopefully once this PR lands yarnpkg/yarn#7419 this won't be an issue anymore

@eamodio
Copy link
Member

eamodio commented Jul 30, 2019

@billsedison @kburson Could you try and see if the latest yarn nightly resolves the issue for you?

@eamodio eamodio reopened this Jul 30, 2019
@eamodio eamodio added needs-more-info Needs further information, steps, details, etc. and removed blocked: vscode Caused by or dependent on a VS Code issue or feature labels Jul 30, 2019
@eamodio eamodio removed blocked Blocked or caused by an upstream issue or feature needs-more-info Needs further information, steps, details, etc. labels Oct 1, 2019
@eamodio
Copy link
Member

eamodio commented Oct 1, 2019

Yarn 1.19 is out which contains a fix for this issue.

@eamodio eamodio closed this as completed Oct 1, 2019
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants