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

An error occurs using npm i jsroot. Is my node version wrong? #313

Open
Chunxiao7 opened this issue Jun 12, 2024 · 5 comments
Open

An error occurs using npm i jsroot. Is my node version wrong? #313

Chunxiao7 opened this issue Jun 12, 2024 · 5 comments
Assignees

Comments

@Chunxiao7
Copy link

An error occurs using npm i jsroot. Is my node version wrong?

@linev linev self-assigned this Jun 12, 2024
@linev
Copy link
Member

linev commented Jun 12, 2024

Can you provide more information - your platform, node version.

Latest jsroot requires at least node18 to work.

@Chunxiao7
Copy link
Author

Chunxiao7 commented Jun 12, 2024

The platform is windows11 and the node version is 18.20.3. The following error message is displayed:

`PS D:\New_Desktop\vue-project> npm i jsroot
npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Use your platform's native atob() and btoa() methods instead
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: Use your platform's native DOMException instead
npm warn deprecated [email protected]: This package is no longer supported.
npm warn cleanup Failed to remove some directories [
npm warn cleanup   [
npm warn cleanup     'D:\\New_Desktop\\vue-project\\node_modules\\canvas',
npm warn cleanup     [Error: EBUSY: resource busy or locked, rmdir 'D:\New_Desktop\vue-project\node_modules\canvas'] {
npm warn cleanup       errno: -4082,
npm warn cleanup       code: 'EBUSY',
npm warn cleanup       syscall: 'rmdir',
npm warn cleanup       path: 'D:\\New_Desktop\\vue-project\\node_modules\\canvas'
npm warn cleanup     }
npm warn cleanup   ],
npm warn cleanup   [
npm warn cleanup     'D:\\New_Desktop\\vue-project\\node_modules\\canvas',
npm warn cleanup     [Error: EBUSY: resource busy or locked, rmdir 'D:\New_Desktop\vue-project\node_modules\canvas'] {
npm warn cleanup       errno: -4082,
npm warn cleanup       code: 'EBUSY',
npm warn cleanup       syscall: 'rmdir',
npm warn cleanup       path: 'D:\\New_Desktop\\vue-project\\node_modules\\canvas'
npm warn cleanup     }
npm warn cleanup   ]
npm warn cleanup ]
npm error code 1
npm error path D:\New_Desktop\vue-project\node_modules\gl
npm error command failed
npm error command C:\Windows\system32\cmd.exe /d /s /c prebuild-install || node-gyp rebuild
npm error prebuild-install warn install unable to verify the first certificate
npm error gyp info it worked if it ends with ok
npm error gyp info using [email protected]
npm error gyp info using [email protected] | win32 | x64`

@linev
Copy link
Member

linev commented Jun 12, 2024

I have no experience with node on Windows.
Do you have 32-bits or 64-bits Windows?

On our test platforms it somehow works:

https://github.com/root-project/jsroot/actions/runs/9465458115/job/26075018335

On your platform problem seems to be with gl package.
Do you have all necessary components as listed here:

https://www.npmjs.com/package/gl#windows

Can you try just npm i gl?

@DraTeots
Copy link

I recently experience the same error. What is happening?
One of the dependencies - gl, tries to build some C++ code on your machine.
For this it uses node-gyp, which in turn, should use your machine compiler and installed
libraries. node-gyp requires a build environment and is usual source of problems. In particular usually it tries to use a system library and then build it if it is not found.

  1. On Windows, you may experience npm error gyp ERR. In general, you need
    to install and make available modern python version and MS C++ redistributable.
    The later might be installed standalone or as a bundle of VS Community edition.
    More in this SO answer

  2. On linux machines you may need libgl and gcc building tools to be installed. E.g. on ubuntu:

    sudo apt-get install -y build-essential libgl1-mesa-dev

P.S. IDK if npm error prebuild-install warn install unable to verify the first certificate is the source of a problem as it is marked as warn but labs like to meddle with certificates, then tools can't download source code and other content.

@linev
Copy link
Member

linev commented Jul 26, 2024

In last jsroot version gl was moved from "devDependencies" into "dependencies" because of this problem:

https://root-forum.cern.ch/t/cannot-use-jsroot-in-next-js-react/

gl module requires for all kinds 3d rendering. Without it one cannot produce images with jsroot.

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

3 participants