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

Running install results in error "spawnSync yarn ENOENT" on both Windows and Ubuntu #364

Closed
bjorno43 opened this issue Jan 3, 2021 · 17 comments

Comments

@bjorno43
Copy link

bjorno43 commented Jan 3, 2021

After cloning the repository, trying to run the install command with node results in the following error on Windows (which makes sense to me considering the yarn vs yarn.cmd difference):

Running yarn install
Error: spawnSync yarn ENOENT
    at Object.spawnSync (internal/child_process.js:1041:20)
    at spawnSync (child_process.js:616:24)
    at Object.execFileSync (child_process.js:643:15)
    at run (C:\wamp64\www\cm6\bin\cm.js:59:16)
    at install (C:\wamp64\www\cm6\bin\cm.js:85:3)
    at C:\wamp64\www\cm6\bin\cm.js:32:28
    at new Promise (<anonymous>)
    at start (C:\wamp64\www\cm6\bin\cm.js:32:3)
    at Object.<anonymous> (C:\wamp64\www\cm6\bin\cm.js:398:1)
    at Module._compile (internal/modules/cjs/loader.js:1137:30) {
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawnSync yarn.cmd',
  path: 'yarn',
  spawnargs: [ 'install' ],
  error: [Circular],
  status: null,
  signal: null,
  output: null,
  pid: 0,
  stdout: null,
  stderr: null
}

On Ubuntu however I run in pretty much the same issue:

Running yarn install
{ Error: spawnSync yarn ENOENT
    at Object.spawnSync (internal/child_process.js:1002:20)
    at spawnSync (child_process.js:614:24)
    at Object.execFileSync (child_process.js:642:13)
    at run (/var/www/clients/client0/web1/web/cm6/codemirror.next/bin/cm.js:59:16)
    at install (/var/www/clients/client0/web1/web/cm6/codemirror.next/bin/cm.js:85:3)
    at r (/var/www/clients/client0/web1/web/cm6/codemirror.next/bin/cm.js:32:28)
    at new Promise (<anonymous>)
    at start (/var/www/clients/client0/web1/web/cm6/codemirror.next/bin/cm.js:32:3)
    at Object.<anonymous> (/var/www/clients/client0/web1/web/cm6/codemirror.next/bin/cm.js:398:1)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawnSync yarn',
  path: 'yarn',
  spawnargs: [ 'install' ],
  error: [Circular],
  status: null,
  signal: null,
  output: null,
  pid: 2447650,
  stdout: null,
  stderr: null }
@marijnh
Copy link
Member

marijnh commented Jan 3, 2021

You have to install yarn. I'll add a note about that to the README.

@marijnh marijnh closed this as completed Jan 3, 2021
marijnh added a commit that referenced this issue Jan 3, 2021
@bjorno43
Copy link
Author

bjorno43 commented Jan 3, 2021

@marijnh Thanks, that did help. Unfortunately I still run into errors after installing Yarn though:

warning mocha > [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
warning mocha > chokidar > [email protected]: Please update to v 2.2.x
warning rollup > [email protected]: Please update to v 2.2.x
warning mocha > [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
warning mocha > chokidar > [email protected]: Please update to v 2.2.x
error https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: "ENOENT: no such file or directory, chmod '/usr/local/share/.cache/yarn/v6/npm-lodash-4.17.20-b44a9b6297bcb698f1c51a3545a2b3b368d59c52-integrity/node_modules/lodash/_asciiToArray.js'"
{ Error: Command failed: yarn install
    at checkExecSyncError (child_process.js:629:11)
    at Object.execFileSync (child_process.js:647:13)
    at run (/var/www/clients/client0/web1/web/cm6/codemirror.next/bin/cm.js:59:16)
    at install (/var/www/clients/client0/web1/web/cm6/codemirror.next/bin/cm.js:85:3)
    at r (/var/www/clients/client0/web1/web/cm6/codemirror.next/bin/cm.js:32:28)
    at new Promise (<anonymous>)
    at start (/var/www/clients/client0/web1/web/cm6/codemirror.next/bin/cm.js:32:3)
    at Object.<anonymous> (/var/www/clients/client0/web1/web/cm6/codemirror.next/bin/cm.js:398:1)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
  status: 1,
  signal: null,
  output:
   [ null,
     'yarn install v1.22.5\ninfo No lockfile found.\n[1/4] Resolving packages...\n[2/4] Fetching packages...\ninfo No lockfile found.\n[1/4] Resolving packages...\n[2/4] Fetching packages...\ninfo Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.\n',
     null ],
  pid: 2457406,
  stdout:
   'yarn install v1.22.5\ninfo No lockfile found.\n[1/4] Resolving packages...\n[2/4] Fetching packages...\ninfo No lockfile found.\n[1/4] Resolving packages...\n[2/4] Fetching packages...\ninfo Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.\n',
  stderr: null }

@marijnh
Copy link
Member

marijnh commented Jan 3, 2021

Ah, interesting, that's the same error the CI job is failing with. I'll investigate.

@marijnh
Copy link
Member

marijnh commented Jan 4, 2021

Seems to have been a yarn bug related to git repository dependencies (similar to this issue, though that is closed). I've temporarily removed those (non-essential) dependencies until I can release them on NPM, and the build is green again.

@bjorno43
Copy link
Author

bjorno43 commented Jan 4, 2021

@marijnh Ghehe, I'm hoping you're not getting tired of me, but I'm afraid it still won't install xD Don't worry, it's not a complaint. I'm not in a hurry or anything, just giving you head ups so you know what's going on :D The error I'm getting now while trying to run install is this:

Running yarn install
warning mocha > [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
warning mocha > chokidar > [email protected]: Please update to v 2.2.x
warning rollup > [email protected]: Please update to v 2.2.x
{ Error: Cannot find module 'lezer-generator/rollup'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at rollupConfig (/var/www/clients/client0/web1/web/cm6/codemirror.next/bin/cm.js:122:15)
    at Array.map (<anonymous>)
    at build (/var/www/clients/client0/web1/web/cm6/codemirror.next/bin/cm.js:148:33)
    at r (/var/www/clients/client0/web1/web/cm6/codemirror.next/bin/cm.js:32:28)
    at new Promise (<anonymous>)
    at start (/var/www/clients/client0/web1/web/cm6/codemirror.next/bin/cm.js:32:3) code: 'MODULE_NOT_FOUND' }
error Command failed with exit code 1.
{ Error: Command failed: yarn install
    at checkExecSyncError (child_process.js:629:11)
    at Object.execFileSync (child_process.js:647:13)
    at run (/var/www/clients/client0/web1/web/cm6/codemirror.next/bin/cm.js:59:16)
    at install (/var/www/clients/client0/web1/web/cm6/codemirror.next/bin/cm.js:85:3)
    at r (/var/www/clients/client0/web1/web/cm6/codemirror.next/bin/cm.js:32:28)
    at new Promise (<anonymous>)
    at start (/var/www/clients/client0/web1/web/cm6/codemirror.next/bin/cm.js:32:3)
    at Object.<anonymous> (/var/www/clients/client0/web1/web/cm6/codemirror.next/bin/cm.js:382:1)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
  status: 1,
  signal: null,
  output:
   [ null,
     'yarn install v1.22.5\ninfo No lockfile found.\n[1/4] Resolving packages...\n[2/4] Fetching packages...\ninfo [email protected]: The platform "linux" is incompatible with this module.\ninfo "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.\n[3/4] Linking dependencies...\n[4/4] Building fresh packages...\nsuccess Saved lockfile.\n$ node bin/cm.js build\nRunning TypeScript compiler...\nDone in 21.14s\nBuilding bundles...\ninfo Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.\n',
     null ],
  pid: 2636267,
  stdout:
   'yarn install v1.22.5\ninfo No lockfile found.\n[1/4] Resolving packages...\n[2/4] Fetching packages...\ninfo [email protected]: The platform "linux" is incompatible with this module.\ninfo "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.\n[3/4] Linking dependencies...\n[4/4] Building fresh packages...\nsuccess Saved lockfile.\n$ node bin/cm.js build\nRunning TypeScript compiler...\nDone in 21.14s\nBuilding bundles...\ninfo Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.\n',
  stderr: null }

@marijnh
Copy link
Member

marijnh commented Jan 4, 2021

Upgrade to node 14 or 15.

@bjorno43
Copy link
Author

bjorno43 commented Jan 4, 2021

@marijnh Yup, that was it! Install was successful! Thanks a lot for your help and patience with me :)

@marijnh
Copy link
Member

marijnh commented Jan 4, 2021

Great to hear. Things should get smoother over time—you're probably one of the first to even run the multi-package setup outside of my laptop.

@bjorno43
Copy link
Author

bjorno43 commented Jan 4, 2021

@marijnh Ah alright, haha. Well I'm very interested in version 6 because it supports collaboration (operational transformation). I know this is already possible with ot.js and CodeMirror 5, but I really want to use a PHP based websocket server instead of NodeJS. Hence I'm very interested in CodeMirror handling most of the OT itself client side.

@curran
Copy link
Contributor

curran commented Jan 4, 2021

Whoah, CM6 supports OT out of the box? Where is this documented? I'm curious to learn more.

@bjorno43
Copy link
Author

bjorno43 commented Jan 4, 2021

@curran
Copy link
Contributor

curran commented Jan 4, 2021

👀 Thanks!

@curran
Copy link
Contributor

curran commented Jan 4, 2021

This is suuuuper fascinating, as I'm using CM5 now with ShareDB, which does JSON OT.

I'm curious if there is any story around presence (e.g. seeing other people's cursors) with this CM6 collab implementation.

One day in the future I hope to refresh this work I did on 2018 and do a proper integration between ShareDB and CodeMirror 6: https://currankelleher.medium.com/codemirror-6-experiments-a3930bf03781

This collab module will probably end up serving as a blueprint for that!

Wow, kudos to @marijnh for the steady stream of development effort on CM6. So much has been added and improved since I was last looking at this project!

@bjorno43
Copy link
Author

bjorno43 commented Jan 4, 2021

@curran I actually found your blog posts earlier this week. Quite some interesting stuff you wrote there! Personally I'm just trying to get rid of Node in the backend. I'm an oldskool dev (was around long before Node existed) and really prefer working with OOP in PHP instead.

Been actually writing my own OT server for CodeMirror with some pretty interesting results so far. Just relying on CM's change event. Applying OT on the server and finally applying it to clients through CM's replaceRange() method. Interesting part there is that CM automatically transforms the client's mouse position. No need to worry about this yourself.

@curran
Copy link
Contributor

curran commented Jan 4, 2021

CM automatically transforms the client's mouse position.

Yeah that's a really nice feature!

I wish it could do the same for "bookmarks" (or the CM6 equivalent of that). I'm having trouble getting the presence cursors to transform, which seems to require some additional work.

@marijnh
Copy link
Member

marijnh commented Jan 5, 2021

There are no bookmarks—the way to track positions is to keep them in your state somewhere and map them forward when a change happens.

@bjorno43
Copy link
Author

bjorno43 commented Jan 9, 2021

@curran Mostly updated ot.js to work with CM5 and added multiple documents support to it. OT updates text, cursors and selections. Thought you might be interested in it: https://github.com/bjorno43/ot.js-multi-docs :)

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

3 participants