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

Local npm install errors out on Node.js v20 #250

Open
4 of 8 tasks
astorije opened this issue Jul 5, 2023 · 0 comments
Open
4 of 8 tasks

Local npm install errors out on Node.js v20 #250

astorije opened this issue Jul 5, 2023 · 0 comments

Comments

@astorije
Copy link
Contributor

astorije commented Jul 5, 2023

Describe the bug

How to reproduce

Steps to reproduce the behavior:

  1. Clone this repo
  2. Make sure you're running Node.js v20.3.1 (I have not tried other v20 versions but I expect the same result)
  3. Run npm install
  4. See error:
% npm install
npm WARN deprecated @npmcli/[email protected]: This functionality has been moved to @npmcli/fs
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
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]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: This module is no longer maintained, try this instead:
npm WARN deprecated   npm i nyc
npm WARN deprecated Visit https://istanbul.js.org/integrations for other alternatives.
npm WARN deprecated [email protected]: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm ERR! code 1
npm ERR! path /[...]/core/node_modules/lmdb
npm ERR! command failed
npm ERR! command sh -c node-gyp-build
npm ERR! CXX(target) Release/obj.target/lmdb/src/lmdb-js.o
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | darwin | x64
npm ERR! gyp info find Python using Python version 3.10.8 found at "/usr/local/opt/[email protected]/bin/python3.10"
npm ERR! gyp info spawn /usr/local/opt/[email protected]/bin/python3.10
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/[...]/core/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/[...]/core/node_modules/lmdb/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/[...]/core/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/johndough/Library/Caches/node-gyp/20.3.1/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/Users/johndough/Library/Caches/node-gyp/20.3.1',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/[...]/core/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/johndough/Library/Caches/node-gyp/20.3.1/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/[...]/core/node_modules/lmdb',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! In file included from ../src/lmdb-js.cpp:1:
npm ERR! In file included from ../src/lmdb-js.h:32:
npm ERR! In file included from ../../nan/nan.h:178:
npm ERR! ../../nan/nan_callbacks.h:55:23: error: no member named 'AccessorSignature' in namespace 'v8'
npm ERR! typedef v8::Local<v8::AccessorSignature> Sig;
npm ERR!                   ~~~~^
npm ERR! In file included from ../src/lmdb-js.cpp:1:
npm ERR! In file included from ../src/lmdb-js.h:32:
npm ERR! ../../nan/nan.h:684:39: warning: 'IdleNotificationDeadline' is deprecated: Use MemoryPressureNotification() to influence the GC schedule. [-Wdeprecated-declarations]
npm ERR!     return v8::Isolate::GetCurrent()->IdleNotificationDeadline(
npm ERR!                                       ^
npm ERR! /Users/johndough/Library/Caches/node-gyp/20.3.1/include/node/v8-isolate.h:1291:3: note: 'IdleNotificationDeadline' has been explicitly marked deprecated here
npm ERR!   V8_DEPRECATE_SOON(
npm ERR!   ^
npm ERR! /Users/johndough/Library/Caches/node-gyp/20.3.1/include/node/v8config.h:550:39: note: expanded from macro 'V8_DEPRECATE_SOON'
npm ERR! # define V8_DEPRECATE_SOON(message) [[deprecated(message)]]
npm ERR!                                       ^
npm ERR! In file included from ../src/lmdb-js.cpp:1:
npm ERR! In file included from ../src/lmdb-js.h:32:
npm ERR! ../../nan/nan.h:2544:8: error: no matching member function for call to 'SetAccessor'
npm ERR!   tpl->SetAccessor(
npm ERR!   ~~~~~^~~~~~~~~~~
npm ERR! /Users/johndough/Library/Caches/node-gyp/20.3.1/include/node/v8-template.h:816:8: note: candidate function not viable: no known conversion from 'imp::Sig' (aka 'int') to 'v8::SideEffectType' for 7th argument
npm ERR!   void SetAccessor(
npm ERR!        ^
npm ERR! /Users/johndough/Library/Caches/node-gyp/20.3.1/include/node/v8-template.h:809:8: note: candidate function not viable: no known conversion from 'imp::NativeGetter' (aka 'void (*)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value> &)') to 'v8::AccessorGetterCallback' (aka 'void (*)(Local<v8::String>, const PropertyCallbackInfo<v8::Value> &)') for 2nd argument
npm ERR!   void SetAccessor(
npm ERR!        ^
npm ERR! 1 warning and 2 errors generated.
npm ERR! make: *** [Release/obj.target/lmdb/src/lmdb-js.o] Error 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/[...]/core/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:511:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:293:12)
npm ERR! gyp ERR! System Darwin 22.5.0
npm ERR! gyp ERR! command "/usr/local/bin/node" "/[...]/core/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /[...]/core/node_modules/lmdb
npm ERR! gyp ERR! node -v v20.3.1
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok

Expected behavior

This is what one would expect (this was produced while running on v18.16.1, i.e. the current LTS):

% npm install
npm WARN deprecated @types/[email protected]: This is a stub types definition for jasmine-expect (https://github.com/JamieMason/Jasmine-Matchers). jasmine-expect provides its own type definitions, so you don\'t need @types/jasmine-expect installed!
npm WARN deprecated @types/[email protected]: This is a stub types definition. cssnano provides its own type definitions, so you do not need this installed.
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated @npmcli/[email protected]: This functionality has been moved to @npmcli/fs
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
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]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410
npm WARN deprecated [email protected]: This module is no longer maintained, try this instead:
npm WARN deprecated   npm i nyc
npm WARN deprecated Visit https://istanbul.js.org/integrations for other alternatives.
npm WARN deprecated [email protected]: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated [email protected]: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.

> prepare
> husky install

husky - Git hooks installed

added 5570 packages, and audited 5797 packages in 3m

550 packages are looking for funding
  run `npm fund` for details

206 vulnerabilities (1 low, 169 moderate, 35 high, 1 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.

Versions

Clarity project:

  • Clarity Core
  • Clarity Angular/UI

This is while running npm install on the top-level directory (to be able to build and run Storybook), so I believe both are affected, but note that we exclusively use Clarity Core.

Clarity version:

  • v5.x
  • v6.x

We exclusively use Clarity Core v6, and this is running from source, on latest main, so definitely happening for v6.x. I would expect the same, or worse, on v5.x.

Framework:

  • Angular
  • React
  • Vue
  • Other: Irrelevant here

Device:

  • Type: MacBook Pro
  • OS: Ventura 13.4.1
  • Browser: N/A
  • Version N/A

Additional notes

I think a good starting point would be to upgrade dependencies as a lot are giving deprecation warning. Some might be harder to upgrade, but doing so one-by-one, low-hanging fruits first, would definitely help. At CloudHealth we use Renovate (website / repo) and it's been exceptional.

This is the output of npm outdated at the time of opening this issue:

Package                                  Current        Wanted   Latest  Location                                                     Depended by
@babel/plugin-transform-react-jsx         7.17.3        7.22.5   7.22.5  node_modules/@babel/plugin-transform-react-jsx               core@npm:core-ws@
@custom-elements-manifest/analyzer         0.5.7         0.5.7    0.8.3  node_modules/@custom-elements-manifest/analyzer              core@npm:core-ws@
@open-wc/dev-server-hmr                    0.1.2         0.1.2    0.2.0  node_modules/@open-wc/dev-server-hmr                         core@npm:core-ws@
@rollup/plugin-alias                       3.1.9         3.1.9    5.0.0  node_modules/@rollup/plugin-alias                            core@npm:core-ws@
@rollup/plugin-image                       2.1.1         2.1.1    3.0.2  node_modules/@rollup/plugin-image                            core@npm:core-ws@
@rollup/plugin-json                        4.1.0         4.1.0    6.0.0  node_modules/@rollup/plugin-json                             core@npm:core-ws@
@rollup/plugin-node-resolve               13.1.3        13.1.3   15.1.0  node_modules/@rollup/plugin-node-resolve                     core@npm:core-ws@
@rollup/plugin-replace                     3.0.1         3.0.1    5.0.2  node_modules/@rollup/plugin-replace                          core@npm:core-ws@
@rollup/plugin-typescript                  8.3.0         8.3.0   11.1.2  projects/core/node_modules/@rollup/plugin-typescript         core@npm:core-ws@
@rollup/plugin-virtual                     2.0.3         2.0.3    3.0.1  node_modules/@rollup/plugin-virtual                          core@npm:core-ws@
@types/jasmine                            3.10.3        3.10.3    4.3.5  node_modules/@types/jasmine                                  core@npm:core-ws@
@types/node                             14.17.34      14.17.34   20.4.0  node_modules/@types/node                                     core@npm:core-ws@
@types/ramda                             0.27.11       0.27.11   0.29.3  projects/core/node_modules/@types/ramda                      core@npm:core-ws@
@typescript-eslint/eslint-plugin           5.9.1         5.9.1   5.61.0  projects/core/node_modules/@typescript-eslint/eslint-plugin  core@npm:core-ws@
@typescript-eslint/parser                  5.9.1         5.9.1   5.61.0  projects/core/node_modules/@typescript-eslint/parser         core@npm:core-ws@
@web/dev-server                           0.1.29        0.1.29    0.2.5  node_modules/@web/dev-server                                 core@npm:core-ws@
@web/dev-server-esbuild                   0.2.16        0.2.16    0.4.1  node_modules/@web/dev-server-esbuild                         core@npm:core-ws@
@web/dev-server-import-maps                0.0.6         0.0.6    0.1.1  node_modules/@web/dev-server-import-maps                     core@npm:core-ws@
@web/dev-server-rollup                    0.3.15        0.3.15    0.5.1  node_modules/@web/dev-server-rollup                          core@npm:core-ws@
@web/dev-server-storybook                  0.4.2         0.4.2    0.7.4  node_modules/@web/dev-server-storybook                       core@npm:core-ws@
@web/test-runner                         0.13.26       0.13.26   0.16.1  node_modules/@web/test-runner                                core@npm:core-ws@
@web/test-runner-commands                  0.6.1         0.6.1    0.7.0  node_modules/@web/test-runner-commands                       core@npm:core-ws@
@web/test-runner-playwright                0.8.8         0.8.8   0.10.1  node_modules/@web/test-runner-playwright                     core@npm:core-ws@
autoprefixer                              10.4.2        10.4.2  10.4.14  node_modules/autoprefixer                                    core@npm:core-ws@
browserslist                              4.19.1        4.19.1   4.21.9  node_modules/browserslist                                    core@npm:core-ws@
bundlesize                          1.0.0-beta.2  1.0.0-beta.2   0.18.1  node_modules/bundlesize                                      core@npm:core-ws@
cem-plugin-module-file-extensions          0.0.2         0.0.2    0.0.5  node_modules/cem-plugin-module-file-extensions               core@npm:core-ws@
cem-plugin-readonly                        0.0.2         0.0.2    0.0.5  node_modules/cem-plugin-readonly                             core@npm:core-ws@
csso                                       5.0.2         5.0.2    5.0.5  node_modules/csso                                            core@npm:core-ws@
eslint-plugin-lit                          1.6.1         1.6.1    1.8.3  node_modules/eslint-plugin-lit                               core@npm:core-ws@
eslint-plugin-lit-a11y                     2.2.0         2.2.0    4.0.0  node_modules/eslint-plugin-lit-a11y                          core@npm:core-ws@
eslint-plugin-rulesdir                     0.2.1         0.2.1    0.2.2  node_modules/eslint-plugin-rulesdir                          core@npm:core-ws@
eslint-plugin-wc                           1.3.2         1.3.2    1.5.0  node_modules/eslint-plugin-wc                                core@npm:core-ws@
fs-extra                                  10.0.0        10.0.0   11.1.1  node_modules/fs-extra                                        core@npm:core-ws@
glob                                       7.2.0         7.2.0   10.3.1  node_modules/glob                                            core@npm:core-ws@
jasmine                                    4.0.2         4.0.2    5.0.2  projects/core/node_modules/jasmine                           core@npm:core-ws@
lit                                        2.2.3         2.7.6    2.7.6  projects/core/node_modules/lit                               core@npm:core-ws@
modern-normalize                           1.1.0         1.1.0    2.0.0  node_modules/modern-normalize                                core@npm:core-ws@
playwright                                1.18.0        1.18.0   1.35.1  node_modules/playwright                                      core@npm:core-ws@
postcss                                    8.4.5         8.4.5   8.4.24  node_modules/postcss                                         core@npm:core-ws@
purgecss                                   4.1.3         4.1.3    5.0.0  node_modules/purgecss                                        core@npm:core-ws@
rollup                                    2.64.0        2.64.0   3.26.1  node_modules/rollup                                          core@npm:core-ws@
rollup-plugin-shell                        1.0.3         1.0.3    1.0.9  node_modules/rollup-plugin-shell                             core@npm:core-ws@
sass                                      1.48.0        1.48.0   1.63.6  node_modules/sass                                            core@npm:core-ws@
terser                                    5.10.0        5.10.0   5.18.2  node_modules/terser                                          core@npm:core-ws@
ts-node                                   10.4.0        10.4.0   10.9.1  node_modules/ts-node                                         core@npm:core-ws@
tslib                                      2.4.0         2.6.0    2.6.0  projects/core/node_modules/tslib                             core@npm:core-ws@
typescript                                 4.5.4         4.5.4    5.1.6  node_modules/typescript                                      core@npm:core-ws@
web-test-runner-jasmine                    0.0.1         0.0.1    0.0.5  node_modules/web-test-runner-jasmine                         core@npm:core-ws@
web-test-runner-performance                0.1.4         0.1.5    0.1.5  node_modules/web-test-runner-performance                     core@npm:core-ws@

That's a lot 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant