code-server version: OS 10.14.6When trying to build locally I get this error:
Command failed: yarn gulp compile-extensions-build --max-old-space-size=32384
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module 'gulp-bom'
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:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
error Command failed with exit code 1.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Did you run yarn install?
yes. I also tried npm install. also on ubuntu aws doesn't work. I am adding a new issue
neither docker
read this .. https://github.com/cdr/code-server/issues/1087#issuecomment-545198551
@pioneerlabs try running yarn first before doing a build, that should solve the issues.
yes I did. I tried also to remove the yarn.lock but I am still getting
Command failed: yarn gulp compile-extensions-build --max-old-space-size=32384
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module 'gulp-bom'
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:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
error Command failed with exit code 1.
they marked as off-topic. my comment above.. but I already explained that on my reference above
u had to remove node_modules delete the pkg lock. and delete the output path.. then install gulp-bom first on the code-server folder.. o
npm install gulp-bom and yarn add gulp-bom
then build it. its a bug that I found also annoying even if you do yarn first.
or just delete the whole code-server and start over again xD also if you set the output path delete that too
see it gulp-bom doesnt exist if you do yarn first
root@leet2:~# mkdir test
cd testroot@leet2:~# cd test
root@leet2:~/test# ls
root@leet2:~/test# ls
root@leet2:~/test# git clone https://github.com/cdr/code-server.git
Cloning into 'code-server'...
remote: Enumerating objects: 118, done.
remote: Counting objects: 100% (118/118), done.
remote: Compressing objects: 100% (82/82), done.
remote: Total 5723 (delta 71), reused 72 (delta 35), pack-reused 5605
Receiving objects: 100% (5723/5723), 9.26 MiB | 10.26 MiB/s, done.
Resolving deltas: 100% (3662/3662), done.
root@leet2:~/test# cd code*
root@leet2:~/test/code-server# export OUT=/root/test/bin
root@leet2:~/test/code-server# yarn
yarn install v1.19.1
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > @coder/[email protected]" has unmet peer dependency "@google-cloud/logging@^4.5.2".
[4/4] Building fresh packages...
Done in 11.17s.
root@leet2:~/test/code-server# ls
doc Dockerfile LICENSE main.js node_modules package.json README.md scripts src tslint.json typings yarn.lock
root@leet2:~/test/code-server# cd node_modules
root@leet2:~/test/code-server/node_modules# ls
abbrev concat-map has-flag jszip pem string.prototype.trimright
ansi-align configstore has-symbols kind-of p-finally string-width
ansi-styles copy-descriptor has-value latest-version pify strip-eof
anymatch core-util-is has-values log-symbols posix-character-classes strip-json-comments
arg create-error-class httpolyglot lowercase-keys prepend-http supports-color
array-unique cross-spawn ignore-by-default lru-cache process-nextick-args tar-fs
arr-diff crypt import-lazy make-dir pseudomap tar-stream
arr-flatten crypto-random-string imurmurhash make-error pstree.remy term-size
arr-union debug inflight map-cache pump timed-out
assign-symbols decode-uri-component inherits map-visit rc to-object-path
async-each deep-extend ini md5 readable-stream to-regex
atob defaults is-accessor-descriptor micromatch readdirp to-regex-range
balanced-match define-properties is-arguments mimic-fn regex-not touch
base define-property isarray minimatch registry-auth-token ts-node
binary-extensions diff is-binary-path minimist registry-url @types
bl dot-prop is-buffer mixin-deep remove-trailing-separator typescript
boxen duplexer3 is-callable mkdirp repeat-element undefsafe
brace-expansion end-of-stream is-ci ms repeat-string union-value
braces es6-promisify is-data-descriptor nanomatch resolve-url unique-string
buffer-alloc es-abstract is-date-object node-fetch restore-cursor universalify
buffer-alloc-unsafe escape-string-regexp is-descriptor nodemon ret unset-value
buffer-fill es-to-primitive isexe nopt safe-buffer unzip-response
buffer-from execa is-extendable normalize-path safe-compare upath
cache-base expand-brackets is-extglob npm-run-path safe-regex update-notifier
camelcase extend-shallow is-fullwidth-code-point object-copy semver urix
capture-stack-trace extglob is-generator-function object.entries semver-diff url-parse-lax
chalk fill-range is-glob object-inspect set-value use
charenc for-in is-installed-globally object-keys shebang-command util
chokidar fragment-cache is-npm object.pick shebang-regex util-deprecate
chownr fs-constants is-number object-visit signal-exit wcwidth
ci-info fs-extra is-obj once snapdragon which
class-utils fs.realpath isobject onetime snapdragon-node widest-line
cli-boxes function-bind is-path-inside ora snapdragon-util wrappy
cli-cursor get-stream is-plain-object os-tmpdir source-map write-file-atomic
cli-spinners get-value is-redirect package-json source-map-resolve xdg-basedir
clone glob is-regex pako source-map-support yn
@coder global-dirs is-retry-allowed pascalcase source-map-url
collection-visit glob-parent is-stream path-dirname split-string
color-convert got is-symbol path-is-absolute static-extend
color-name graceful-fs is-windows path-is-inside string_decoder
component-emitter has jsonfile path-key string.prototype.trimleft
root@leet2:~/test/code-server/node_modules# cd gulp-bom
-bash: cd: gulp-bom: No such file or directory
root@leet2:~/test/code-server/node_modules#
That doesn't have to do with anything on how yarn build works, you're cding to the node_modules for code-server. Problem is in source/vscode-1.39.2-source/build/ @Dj-jom2x, hence why I marked it off-topic since its not even relevant.
I can't replicate this issue btw OP @pioneerlabs. Something wrong happened on your end since CIs report fine.
I'm also not able to replicate. Could you clone a fresh repository (either to a new directory or delete the current one) and run yarn build 1.39.2 development (and nothing else)?
Then if that doesn't work try manually installing the build dependencies:
cd source/vscode-1.39.2-source/build
yarn
Make sure that completed without errors, then check if gulp-bom has been installed:
file node_modules/gulp-bom
Ran into this exact same issue today.
OS: Ubuntu 18.04.2 LTS (bionic)
Node: v10.17.0
I'm also not able to replicate. Could you clone a fresh repository (either to a new directory or delete the current one) and run
yarn build 1.39.2 development(and nothing else)?Then if that doesn't work try manually installing the build dependencies:
cd source/vscode-1.39.2-source/build yarnMake sure that completed without errors, then check if
gulp-bomhas been installed:file node_modules/gulp-bom
This didn't work for me
What was the result of the file command? If gulp-bom doesn't exist then it might be an issue with yarn.
I tried your previous comment once again and this time, I was successfully able to but a version of code-server. Thank you for the help
Side note, I didn't really change anything so I'm not sure what went wrong the first time
Since there's no more traffic in this issue, I'm marking this off as closed. Let me know if its still persistent otherwise try a clean tree again.
I just ran into this as well, and doing an rm -rf $OUT/source and re-running the build fixed it. My guess is that if you run the build, interrupt it before it installs _all_ dependencies (e.g. by ctrl+cing out of it) that you get stuck in a state where the build script thinks you have the dependencies, but you don't.
We could probably fix this by just always running yarn here instead of conditionally based on the node_modules folder: https://github.com/cdr/code-server/blob/master/scripts/build.ts#L172-L178 but I'm not sure what the speed implications are here for CI.
Most helpful comment
I tried your previous comment once again and this time, I was successfully able to but a version of code-server. Thank you for the help
Side note, I didn't really change anything so I'm not sure what went wrong the first time