github / CopilotForXcode

Xcode extension for GitHub Copilot
MIT License
1.94k stars 37 forks source link

nit: need to run npm install to build the app #11

Closed gsabran closed 4 weeks ago

gsabran commented 1 month ago

After running sudo ln -s `which npm` /usr/local/bin, I think you need to run npm install from Server to be able to build the app. The later step is not described in the DEVELOPMENT.md

Versions

Steps to reproduce

  1. Clone the repo
  2. Make sure sudo ln -s `which npm` /usr/local/bin has been run
  3. Build the app

Screenshots

Screenshot 2024-10-30 at 9 38 38 AM

Logs

env: node: No such file or directory cp: Server/node_modules/@github/copilot-language-server/native/darwin-arm64/copilot-language-server: No such file or directory Command PhaseScriptExecution failed with a nonzero exit code

devm33 commented 1 month ago

From env: node: No such file or directory it looks like node is not installed a global location that the Xcode run script can reach. Maybe try symlinking node as well

sudo ln -s `which node` /usr/local/bin
gsabran commented 1 month ago

For me, running npm install is what solved the issue. I had also run sudo ln -swhich node/usr/local/bin before to be sure that was not the cause.

devm33 commented 1 month ago

Yep, npm install is run as part of a custom build script: https://github.com/github/CopilotForXcode/blob/a9ad824d0da3908f06bf90cc3c70b2e0d4c879f1/Copilot%20for%20Xcode.xcodeproj/project.pbxproj#L719

However, the PATH Xcode uses for custom build scripts is fairly bare, hence the need to link things to standard locations like /usr/local/bin

gsabran commented 4 weeks ago

ACK, then maybe sudo ln -swhich node/usr/local/bin is what I was initially missing.

devm33 commented 4 weeks ago

Makes sense I'll update DEVELOPMENT.md to mention that, thanks!