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

How to run locally after clone for development mode? #735

Closed
mukeshkmr776 opened this issue Jun 1, 2019 · 13 comments
Closed

How to run locally after clone for development mode? #735

mukeshkmr776 opened this issue Jun 1, 2019 · 13 comments

Comments

@mukeshkmr776
Copy link

Description

Please provide clear steps on how to run this project (after git clone) from local.

I saw #17 #335 #430 #555 #571, but no clear steps were ever mentioned. If there is any document for the same, please give me a link.

Related Issues

I had a look in package.json which is placed in root folder of this project.

Tried few steps to start it locally:

  1. npm install <- successfully executed
  2. npm start <- failed with TS Errors. See attached logs for the same.

My Machine Details:-
Ubuntu - 19.04

LOG- npm-start.log

Screenshot below:
screenshot

@mukeshkmr776
Copy link
Author

@coadler @kylecarbs @scsmithr

@deansheather
Copy link
Member

After installing libxkbfile-dev and libsecret-1-dev dependencies, you should be able to do yarn and NODE_ENV=production yarn task build:server:binary to build a binary.

You can find the binary in ./packages/server/cli-linux-64.

@ddezoysa
Copy link

ddezoysa commented Jun 7, 2019

  1. Newly installed Ubuntu 19.04 into a VM.
  2. Cloned the code from master.
  3. Installed Node v10.16.0, Yarn 1.13, libxkbfile-dev, libsecret-1-dev, net-tools
  4. Executed yarn and NODE_ENV=production yarn task build:server:binary. Build worked with no issues.
  5. Tried yarn start but receiving below error.

ddezoysa@vm-ddezoysa:~/code-server$ yarn start
yarn run v1.13.0
$ cd ./packages/server && yarn start
warning package.json: No license field
warning ../package.json: No license field
$ node --max-old-space-size=32384 --require ts-node/register --require tsconfig-paths/register src/cli.ts

/home/ddezoysa/code-server/packages/server/node_modules/ts-node/src/index.ts:261

return new TSError(diagnosticText, diagnosticCodes)
       ^

TSError: ⨯ Unable to compile TypeScript:
../protocol/src/browser/modules/spdlog.ts(1,25): error TS7016: Could not find a declaration file for module 'spdlog'. '/home/ddezoysa/code-server/node_modules/spdlog/index.js' implicitly has an 'any' type.
Try npm install @types/spdlog if it exists or add a new declaration (.d.ts) file containing declare module 'spdlog';

at createTSError (/home/ddezoysa/code-server/packages/server/node_modules/ts-node/src/index.ts:261:12)
at getOutput (/home/ddezoysa/code-server/packages/server/node_modules/ts-node/src/index.ts:367:40)
at Object.compile (/home/ddezoysa/code-server/packages/server/node_modules/ts-node/src/index.ts:558:11)
at Module.m._compile (/home/ddezoysa/code-server/packages/server/node_modules/ts-node/src/index.ts:439:43)
at Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Object.require.extensions.(anonymous function) [as .ts] (/home/ddezoysa/code-server/packages/server/node_modules/ts-node/src/index.ts:442:12)
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)
at Module.require (internal/modules/cjs/loader.js:690:17)

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.

  1. Tried again after yarn postinstall as well but no luck. Getting the same error.

How to get the code running in developer mode to do some enhancements without building and running in production mode?

@deansheather
Copy link
Member

Oh, my bad. Try this:

yarn
NODE_ENV=production VERSION=local-dev yarn task build:server:binary
yarn task package local-dev

Then you can run the produced binary in the release folder. I don't think yarn start works.

@mukeshkmr776
Copy link
Author

Tried.Its working. Thanks.

Could you please share detailed structure of this project? I couldn't even find the starting point of this. Also, not sure from where how the VSCode view is generating.

Please help here to share some kind of porject structure. It would be easy on me to start working on this asap.
:)

@coadler @kylecarbs @scsmithr @sr229

@sr229
Copy link
Contributor

sr229 commented Jun 16, 2019

code-server uses a patched version of the Visual Studio Code and runs it under a HTTP/S server. So you'd be looking for two things - the Visual Studio Code codebase and the server codebase.

Keep in mind we don't directly submodule or keep our own copy of the vscode repository, we use a patchfile to insert our changes. I forgot how to generate your patchfiles but the developers at Discord will walk you through on how to submit a modification to the patchfile @mukeshkmr776 .

@mukeshkmr776
Copy link
Author

Exactly! You got my point. I am looking for that.
Please walk me through the Patch file, how to apply, on VSCode codebase.

I want to see the diff just to be aware what exactly we have changed to make it live on http/s.

Please help. Connect me with right person. @sr229

@sr229
Copy link
Contributor

sr229 commented Jun 29, 2019

I think we should wait for GH-795 since its going to be easier to work with the codebase.

@VN666
Copy link

VN666 commented Jul 10, 2019

Oh, my bad. Try this:

yarn
NODE_ENV=production VERSION=local-dev yarn task build:server:binary
yarn task package local-dev

Then you can run the produced binary in the release folder. I don't think yarn start works.

when I try your method,it runs! But another question happen:
I run binary code in realse, the terminal module cannot use, details as follow:
image

@sr229
Copy link
Contributor

sr229 commented Jul 10, 2019

CC @coadler, I believe you might have an idea with the Terminal not working for @VN666

@deansheather
Copy link
Member

pty.node is supplied from node-pty: microsoft/node-pty#256. Ensure python --version returns 2.x (if not, change your python preference to python2), as most native Node packages require python2 to build properly, then clean and reinstall with yarn.

Make sure your Node version is v10.15.1, as this is the version we use when building nbin and code-server. node-pty will fail to load pty.node if the version it was compiled with (node --version) doesn't match the version of Node used when running it.

@VN666
Copy link

VN666 commented Jul 24, 2019

CC @coadler, I believe you might have an idea with the Terminal not working for @VN666

just use node v10.15.1, this question will done

@code-asher
Copy link
Member

The new README provides all the steps required to start development. 🎉 Let me know if anything is unclear.

rwhogg added a commit to rwhogg/linuxbrew-core that referenced this issue May 10, 2020
It's not spelled out explicitly in the dependencies, but
it's mentioned as a step here: coder/code-server#735 (comment)
rwhogg added a commit to rwhogg/linuxbrew-core that referenced this issue May 10, 2020
libsecret is not spelled out explicitly in the dependencies, but
it's mentioned as a step here: coder/code-server#735 (comment)

pkg-config was found as a required dep by CI
rwhogg added a commit to rwhogg/linuxbrew-core that referenced this issue May 10, 2020
libsecret is not spelled out explicitly in the dependencies, but
it's mentioned as a step here: coder/code-server#735 (comment)

X11 dependencies were also found by CI
rwhogg added a commit to rwhogg/linuxbrew-core that referenced this issue May 13, 2020
libsecret is not spelled out explicitly in the dependencies, but
it's mentioned as a step here: coder/code-server#735 (comment)

X11 dependencies were also found by CI
rwhogg added a commit to rwhogg/linuxbrew-core that referenced this issue May 19, 2020
libsecret is not spelled out explicitly in the dependencies, but
it's mentioned as a step here: coder/code-server#735 (comment)

X11 dependencies were also found by CI
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

6 participants