Skip to content

Building Code-server in freebsd error with npm and node path error #529

@emanzx

Description

@emanzx
  • code-server version: Github Master
  • OS Version: FreeBSD 11.2

Description

Try to build the code server.

$ node --version
v11.6.0
$ yarn --version
1.12.3
$ npm --version
6.4.1

then:
./scripts/build.sh which halted at :

yarn run v1.12.3
$ ts-node -r tsconfig-paths/register build/tasks.ts build:server:binary
INFO  BUILD:SERVER:BINARY Starting...
INFO  VSCODE:INSTALL Starting...
INFO  VSCODE:INSTALL Executing 'git ["reset","--hard"]' {"options":{"cwd":"/usr/home/system/code-server/lib/vscode"}}
INFO  VSCODE:INSTALL Completed! time=770ms {"time":{"expected":9007199254740991,"ms":1555582202397}}
INFO  BUILD:BOOTSTRAP-FORK Starting...
INFO  BUILD:WEB Starting...
INFO  BUILD:SERVER:BUNDLE Starting...
INFO  BUILD:SERVER:BUNDLE Executing 'npm ["run","build"]' {"options":{"cwd":"/usr/home/system/code-server/packages/server"}}
INFO  BUILD:APP:BROWSER Starting...
INFO  VSCODE:PATCH Starting...
INFO  BUILD:APP:BROWSER Executing 'npm ["run","build"]' {"options":{"cwd":"/usr/home/system/code-server/packages/app/browser"}}
INFO  VSCODE:PATCH Executing 'git ["apply","--unidiff-zero","/usr/home/system/code-server/scripts/vscode.patch"]' {"options":{"cwd":"/usr/home/system/code-server/lib/vscode"}}
INFO  VSCODE:PATCH Completed! time=29ms {"time":{"expected":9007199254740991,"ms":1555582203171}}
INFO  BUILD:BOOTSTRAP-FORK Executing 'npm ["run","build:bootstrap-fork"]' {"options":{"cwd":"/usr/home/system/code-server/packages/vscode"}}
INFO  BUILD:WEB Executing 'npm ["run","build"]' {"options":{"cwd":"/usr/home/system/code-server/packages/web"}}
INFO  BUILD:APP:BROWSER Completed! time=4762ms {"time":{"expected":9007199254740991,"ms":1555582203171}}
INFO  BUILD:SERVER:BUNDLE Completed! time=9376ms {"time":{"expected":9007199254740991,"ms":1555582203168}}
INFO  BUILD:BOOTSTRAP-FORK Completed! time=12902ms {"time":{"expected":9007199254740991,"ms":1555582203167}}
INFO  BUILD:WEB Completed! time=19778ms {"time":{"expected":9007199254740991,"ms":1555582203168}}
INFO  BUILD:SERVER:BINARY:PACKAGE Starting...
INFO  BUILD:SERVER:BINARY:COPY Starting...
INFO  BUILD:SERVER:BINARY:COPY Completed! time=1865ms {"time":{"expected":9007199254740991,"ms":1555582222946}}
INFO  BUILD:SERVER:BINARY:PACKAGE Executing 'npm ["run","build:binary"]' {"options":{"cwd":"/usr/home/system/code-server/packages/server"}}
ERROR BUILD:SERVER:BINARY:PACKAGE failed {"exitCode":1,"stdout":"\n> server@ build:binary /usr/home/system/code-server/packages/server\n> ts-node scripts/nbin.ts\n\n\u001b[1m\u001b[38;2;0;143;191mINFO  \u001b[0mPackaged module\u001b[38;2;140;140;140m {\"module\":\"spdlog\"}\n\u001b[1m\u001b[38;2;0;143;191mINFO  \u001b[0mPackaged module\u001b[38;2;140;140;140m {\"module\":\"node-pty\"}\n\u001b[1m\u001b[38;2;0;143;191mINFO  \u001b[0mPackaged module\u001b[38;2;140;140;140m {\"module\":\"mkdirp\"}\n\u001b[1m\u001b[38;2;0;143;191mINFO  \u001b[0mPackaged module\u001b[38;2;140;140;140m {\"module\":\"bindings\"}\n\u001b[1m\u001b[38;2;0;143;191mINFO  \u001b[0mFetching\u001b[38;2;140;140;140m {\"url\":\"https://nbin.cdr.sh/1.1.2/node-10.15.1-freebsd-x86_64\"}\n","stderr":"npm WARN lifecycle The node binary used for scripts is /tmp/yarn--1555582201821-0.772229819417033/node but npm is using /usr/local/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.\n✔ Wrote 1128 files!\n✔ Wrote 1 file!\nError: Forbidden\n    at e.Binary.<anonymous> (/usr/home/system/code-server/packages/server/node_modules/@coder/nbin/out/api.js:1:43397)\n    at Generator.next (<anonymous>)\n    at s (/usr/home/system/code-server/packages/server/node_modules/@coder/nbin/out/api.js:1:40627)\n    at process.internalTickCallback (internal/process/next_tick.js:77:7)\nnpm ERR! code ELIFECYCLE\nnpm ERR! errno 1\nnpm ERR! server@ build:binary: `ts-node scripts/nbin.ts`\nnpm ERR! Exit status 1\nnpm ERR! \nnpm ERR! Failed at the server@ build:binary script.\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!     /home/system/.npm/_logs/2019-04-18T10_10_26_210Z-debug.log\n"}
ERROR BUILD:SERVER:BINARY:PACKAGE Failed: Failed to package binary: npm WARN lifecycle The node binary used for scripts is /tmp/yarn--1555582201821-0.772229819417033/node but npm is using /usr/local/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
✔ Wrote 1128 files!
✔ Wrote 1 file!
Error: Forbidden
    at e.Binary.<anonymous> (/usr/home/system/code-server/packages/server/node_modules/@coder/nbin/out/api.js:1:43397)
    at Generator.next (<anonymous>)
    at s (/usr/home/system/code-server/packages/server/node_modules/@coder/nbin/out/api.js:1:40627)
    at process.internalTickCallback (internal/process/next_tick.js:77:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! server@ build:binary: `ts-node scripts/nbin.ts`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the server@ build:binary script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/system/.npm/_logs/2019-04-18T10_10_26_210Z-debug.log

ERROR BUILD:SERVER:BINARY:PACKAGE Stack: Error: Failed to package binary: npm WARN lifecycle The node binary used for scripts is /tmp/yarn--1555582201821-0.772229819417033/node but npm is using /usr/local/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
✔ Wrote 1128 files!
✔ Wrote 1 file!
Error: Forbidden
    at e.Binary.<anonymous> (/usr/home/system/code-server/packages/server/node_modules/@coder/nbin/out/api.js:1:43397)
    at Generator.next (<anonymous>)
    at s (/usr/home/system/code-server/packages/server/node_modules/@coder/nbin/out/api.js:1:40627)
    at process.internalTickCallback (internal/process/next_tick.js:77:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! server@ build:binary: `ts-node scripts/nbin.ts`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the server@ build:binary script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/system/.npm/_logs/2019-04-18T10_10_26_210Z-debug.log

    at Object.runner_1.register [as func] (/usr/home/system/code-server/build/tasks.ts:39:9)
    at process.internalTickCallback (internal/process/next_tick.js:77:7)
error Command failed with exit code 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions