Skip to content

nodejs mismatch between the two install methods #4512

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

Closed
heggland opened this issue Nov 15, 2021 · 11 comments
Closed

nodejs mismatch between the two install methods #4512

heggland opened this issue Nov 15, 2021 · 11 comments
Milestone

Comments

@heggland
Copy link

heggland commented Nov 15, 2021

different nodejs versions when I install with curl/npm methods.
I'm just testing on raspberry, which has nodejs version v.12.22.5.
The curl installer just straight up wouldnt work, maybe since its a raspberry I dunno.. It says one need atleast node v12 or newer.
The npm install way says node v14 is required.

curl -fsSL https://code-server.dev/install.sh | sh

curl -fsSL https://code-server.dev/install.sh | sh
Raspbian GNU/Linux 11 (bullseye)
No standalone releases for armv7l.
Falling back to installation from npm.
Installing latest from npm.

Please install npm or yarn to install code-server!
You will need at least node v12 and a few C dependencies.
See the docs https://coder.com/docs/code-server/latest/install#yarn-npm

npm i code-server

npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '= 14' },
npm WARN EBADENGINE   current: { node: 'v12.22.5', npm: '7.5.2' }
npm WARN EBADENGINE }
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: This library will not receive further updates other than security fixes. We recommend using @grpc/grpc-js instead.
npm ERR! code 1
npm ERR! path /home/pi/vscode/node_modules/code-server
npm ERR! command failed
npm ERR! command sh -c bash ./postinstall.sh
npm ERR! ERROR: code-server currently requires node v14.
npm ERR! ./postinstall.sh: line 38: FORCE_NODE_VERSION: unbound variable

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pi/.npm/_logs/2021-11-15T19_59_25_083Z-debug.log
@jsjoeio jsjoeio added the needs-investigation This issue needs to be further investigated label Nov 15, 2021
@jsjoeio
Copy link
Contributor

jsjoeio commented Nov 15, 2021

This is very strange indeed 🤔

The first error message is hard-coded here.

I think to get past this, you can run with the flag --ignore-engines for the npm/yarn way. And also, this should be installed globally so we recommend yarn global add code-server or npm i -g code-server.

@jsjoeio
Copy link
Contributor

jsjoeio commented Nov 15, 2021

The v14 comes from our package.json engines field here. They should definitely be consistent though.

@jsjoeio jsjoeio added the bug Something isn't working label Nov 15, 2021
@jsjoeio jsjoeio added this to the On Deck milestone Nov 15, 2021
@im-coder-lg
Copy link
Contributor

im-coder-lg commented Nov 25, 2021

@heggland do you have Node 14? If you do, try this: sudo npm i -g [email protected]. The reason I recommend you to use the old version is this: #4422

@martadinata666
Copy link

This also happend with newer nodejs, currently testing with node16

Step 4/10 : RUN     node --version &&         npm install -g code-server@"$CODE_RELEASE"
 ---> Running in 62f111952767
v16.13.0
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '= 14' },
npm WARN EBADENGINE   current: { node: 'v16.13.0', npm: '8.1.0' }
npm WARN EBADENGINE }
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: This library will not receive further updates other than security fixes. We recommend using @grpc/grpc-js instead.
npm notice 
npm notice New patch version of npm available! 8.1.0 -> 8.1.4
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v8.1.4>
npm notice Run `npm install -g [email protected]` to update!
npm notice 
npm ERR! code 1
npm ERR! path /usr/lib/node_modules/code-server
npm ERR! command failed
npm ERR! command sh -c bash ./postinstall.sh
npm ERR! ERROR: code-server currently requires node v14.
npm ERR! ./postinstall.sh: line 38: FORCE_NODE_VERSION: unbound variable

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/debian/.npm/_logs/2021-11-28T11_05_50_258Z-debug.log

@im-coder-lg
Copy link
Contributor

Node 14 only works as of now. Until the upstream VSCode supports it, we can't.

@javix64
Copy link

javix64 commented Feb 8, 2022

Regarding this issue... i have installed in my raspberry 4, the node v14.18.2. but is not working anyway
image

Should i use the version [email protected]??
upsi... i have discovered that i have node in version 14, but nodejs in version 16... i need to fix it

@jsjoeio
Copy link
Contributor

jsjoeio commented Feb 8, 2022

upsi... i have discovered that i have node in version 14, but nodejs in version 16... i need to fix it

Ah got it. Let us know if this resolves the issue!

@javix64
Copy link

javix64 commented Feb 8, 2022

Ok. i couldn't installed via npm, no latest version and no 3.12.0 version.
So i have tried via sh script, but when i'm trying to run it it's retrieving this error:
image
There are many issues opened with this weird 'argon', because maybe my system is:
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
aarch64


whatever finally i could installed via sh script with the flag --version 3.12.0:
curl -fsSL https://code-server.dev/install.sh | sh -s -- --version 3.12.0
so that was my weird solution... almost i can use it :)

@im-coder-lg
Copy link
Contributor

Anyone thought of NVM or maybe purging the entire Node.js package from the system and reinstalling it from a tarball? I tried NVM and it seems to work on my Ubuntu Impish instance.

@martadinata666
Copy link

I just use the nodesource repo, https://github.com/nodesource/distributions/blob/master/README.md
As it like all in one so no version mismatch, as NVM is ok but sometimes forgot using it. Well just use what suit you.

@code-asher
Copy link
Member

Closing as this does not appear to be a bug in the code-server repo.

@code-asher code-asher closed this as not planned Won't fix, can't repro, duplicate, stale Jul 11, 2024
@code-asher code-asher removed bug Something isn't working needs-investigation This issue needs to be further investigated labels Jul 11, 2024
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