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 doesn't always install dependencies #38549

Closed
rebornix opened this issue Nov 16, 2017 · 5 comments
Closed

yarn doesn't always install dependencies #38549

rebornix opened this issue Nov 16, 2017 · 5 comments
Assignees
Labels
javascript JavaScript support issues

Comments

@rebornix
Copy link
Member

  • VSCode Version: 1.19-Insider
  • OS Version: macOS

Node: 8.9.1
yarn: 0.16.0

Followed steps in #38481

  • nvm install 8.9.1
  • npm i -g yarn
  • git clean -xfd
  • yarn

Most of the time I got errors when installing vscode-ripgrep

[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
[8/16] ⠐ v8-profiler: CXX(target) Release/obj.target/profiler/src/profiler.o
[9/16] ⠐ vscode-fsevents: spawn args   '-Goutput_dir=.' ]
[10/16] ⠐ vscode-ripgrep
[4/16] ⠐ native-keymap: CXX(target) Release/obj.target/keymapping/src/keyboard_mac.o
error /Users/penlv/code/vscode/node_modules/vscode-ripgrep: Command failed.
Exit code: 1
Command: sh
Arguments: -c node ./dist/postinstall.js
Directory: /Users/penlv/code/vscode/node_modules/vscode-ripgrep
Output:
Downloading ripgrep failed: Error: Missing ./_node_modules...

I succeed installing all the packages twice, after that, I ran yarn watch or gulp watch, I got following errors

yarn watch v0.16.0
$ gulp watch --max_old_space_size=4096
[11:47:44] Node flags detected: --max_old_space_size=4096
[11:47:44] Respawned to PID: 3858
child_process.js:644
    throw err;
    ^

Error: Command failed: yarn list --json
    at checkExecSyncError (child_process.js:601:13)
    at Object.execSync (child_process.js:641:13)
    at getYarnProductionDependencies (/Users/penlv/code/vscode/build/dependencies.js:46:17)
    at Object.getProductionDependencies (/Users/penlv/code/vscode/build/dependencies.js:62:15)
    at Object.<anonymous> (/Users/penlv/code/vscode/build/gulpfile.vscode.js:38:37)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at require.sync.forEach.f (/Users/penlv/code/vscode/gulpfile.js:76:17)
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (/Users/penlv/code/vscode/gulpfile.js:76:4)
    at Module._compile (module.js:635:30)
@vscodebot vscodebot bot added the insiders label Nov 16, 2017
@vscodebot vscodebot bot added the javascript JavaScript support issues label Nov 16, 2017
@rebornix rebornix assigned joaomoreno and unassigned mjbvz Nov 16, 2017
@rebornix
Copy link
Member Author

vscode-ripgrep tries to check node_modules in postinstall, which doesn't exist when doing yarn install.

@rebornix
Copy link
Member Author

Yarn's cache leads to this problem

  • yarn cache clean
  • yarn add vscode-ripgrep
  • vscode-ripgrep has a folder _node_modules, it has a postscript which will remove this folder and add a new folder called bin
  • if we run yarn add vscode-ripgrep again, yarn will load the module directly from cache (which has the bin folder instead of _node_modules) and try to execute postscript again.

@rebornix
Copy link
Member Author

Besides, it only happens on an old version of yarn, upgrading to the latest one solves the problem.

@roblourens
Copy link
Member

Should be fixed now

@joaomoreno
Copy link
Member

Great job guys!

@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 31, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
javascript JavaScript support issues
Projects
None yet
Development

No branches or pull requests

4 participants