Call-for-Code-for-Racial-Justice / Incident-Accuracy-Reporting-System

Incident Accuracy Reporting System (IARS) is a Content Management application that addresses the issue of transparency surrounding police incident reporting by allowing witnesses and/or victims to directly submit evidence (images, videos)
Apache License 2.0
66 stars 25 forks source link

Command "npm install" fails using new versions of NodeJS (Tried 12, 14 and 16) #95

Closed nitekon1 closed 2 years ago

nitekon1 commented 2 years ago

Describe the bug While following setup instructions under:

Getting Started > 5. Start Incident Accuracy Reporting System web application > Start frontend web app

the command npm install fails using NodeJS v12 or higher.

-- While attempting to run command using NodeJS v16 (current LTS) get the following error:

$ npm install
npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: hello-world@0.1.0
npm ERR! Found: sass-loader@7.1.0
npm ERR! node_modules/sass-loader
npm ERR!   dev sass-loader@"^8.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev sass-loader@"^8.0.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: webpack@5.69.1
npm ERR! node_modules/webpack
npm ERR!   peer webpack@"^4.36.0 || ^5.0.0" from sass-loader@8.0.2
npm ERR!   node_modules/sass-loader
npm ERR!     dev sass-loader@"^8.0.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /home/supportuser/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/supportuser/.npm/_logs/2022-02-24T02_32_39_513Z-debug-0.log

-- While attempting to run command using NodeJS v14 get the following error:

$ npm install
npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated html-webpack-plugin@3.2.0: 3.x is no longer supported
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated eslint-loader@2.2.1: This loader has been deprecated. Please use eslint-webpack-plugin
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
npm WARN deprecated axios@0.15.3: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410
npm WARN deprecated core-js@2.6.12: 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 @hapi/joi@15.1.1: Switch to 'npm install joi'
npm WARN deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated xmldom@0.1.31: Deprecated due to CVE-2021-21366 resolved in 0.5.0
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: 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 gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address'
npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated natives@1.1.6: This module relies on Node.js's internals and will break at some point. Do not use it, and update to graceful-fs@4.x.
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated mumath@3.3.4: Redundant dependency in your project.
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs@1.2.3: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js

> yorkie@2.0.0 install /home/supportuser/repos/Incident-Accuracy-Reporting-System/frontend/node_modules/yorkie
> node bin/install.js

setting up Git hooks
can't find .git directory, skipping Git hooks installation

> fibers@5.0.1 install /home/supportuser/repos/Incident-Accuracy-Reporting-System/frontend/node_modules/fibers
> node build.js || nodejs build.js

`linux-x64-83-glibc` exists; testing
Binary is fine; exiting

> node-sass@4.14.1 install /home/supportuser/repos/Incident-Accuracy-Reporting-System/frontend/node_modules/node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.14.1/linux-x64-83_binding.node
Download complete..] - :
Binary saved to /home/supportuser/repos/Incident-Accuracy-Reporting-System/frontend/node_modules/node-sass/vendor/linux-x64-83/binding.node
Caching binary to /home/supportuser/.npm/node-sass/4.14.1/linux-x64-83_binding.node

> semantic-ui@2.4.2 install /home/supportuser/repos/Incident-Accuracy-Reporting-System/frontend/node_modules/semantic-ui
> gulp install

fs.js:40
} = primordials;
    ^

ReferenceError: primordials is not defined
    at fs.js:40:5
    at req_ (/home/supportuser/repos/Incident-Accuracy-Reporting-System/frontend/node_modules/natives/index.js:143:24)
    at Object.req [as require] (/home/supportuser/repos/Incident-Accuracy-Reporting-System/frontend/node_modules/natives/index.js:55:10)
    at Object.<anonymous> (/home/supportuser/repos/Incident-Accuracy-Reporting-System/frontend/node_modules/vinyl-fs/node_modules/graceful-fs/fs.js:1:37)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:101:18)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules/@nuxtjs/vuetify/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules/watchpack/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules/sass/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN @carbon/charts@0.34.11 requires a peer of d3@>=5.0.0 <=5.14.2 but none is installed. You must install peer dependencies yourself.
npm WARN vue2-leaflet@2.7.1 requires a peer of @types/leaflet@^1.5.7 but none is installed. You must install peer dependencies yourself.
npm WARN The package sass-loader is included as both a dev and production dependency.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! semantic-ui@2.4.2 install: `gulp install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the semantic-ui@2.4.2 install 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/supportuser/.npm/_logs/2022-02-25T19_50_41_641Z-debug.log

-- While attempting to run command using NodeJS v12 get the following error:

$ npm install
npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated eslint-loader@2.2.1: This loader has been deprecated. Please use eslint-webpack-plugin
npm WARN deprecated html-webpack-plugin@3.2.0: 3.x is no longer supported
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated axios@0.15.3: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410
npm WARN deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated core-js@2.6.12: 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 @hapi/joi@15.1.1: Switch to 'npm install joi'
npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated xmldom@0.1.31: Deprecated due to CVE-2021-21366 resolved in 0.5.0
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: 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 gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address'
npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated natives@1.1.6: This module relies on Node.js's internals and will break at some point. Do not use it, and update to graceful-fs@4.x.
npm WARN deprecated mumath@3.3.4: Redundant dependency in your project.
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs@1.2.3: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js

> yorkie@2.0.0 install /home/supportuser/repos/Incident-Accuracy-Reporting-System/frontend/node_modules/yorkie
> node bin/install.js

setting up Git hooks
can't find .git directory, skipping Git hooks installation

> fibers@5.0.1 install /home/supportuser/repos/Incident-Accuracy-Reporting-System/frontend/node_modules/fibers
> node build.js || nodejs build.js

`linux-x64-72-glibc` exists; testing
Binary is fine; exiting

> node-sass@4.14.1 install /home/supportuser/repos/Incident-Accuracy-Reporting-System/frontend/node_modules/node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.14.1/linux-x64-72_binding.node
Download complete .] - :
Binary saved to /home/supportuser/repos/Incident-Accuracy-Reporting-System/frontend/node_modules/node-sass/vendor/linux-x64-72/binding.node
Caching binary to /home/supportuser/.npm/node-sass/4.14.1/linux-x64-72_binding.node

> semantic-ui@2.4.2 install /home/supportuser/repos/Incident-Accuracy-Reporting-System/frontend/node_modules/semantic-ui
> gulp install

fs.js:36
} = primordials;
    ^

ReferenceError: primordials is not defined
    at fs.js:36:5
    at req_ (/home/supportuser/repos/Incident-Accuracy-Reporting-System/frontend/node_modules/natives/index.js:143:24)
    at Object.req [as require] (/home/supportuser/repos/Incident-Accuracy-Reporting-System/frontend/node_modules/natives/index.js:55:10)
    at Object.<anonymous> (/home/supportuser/repos/Incident-Accuracy-Reporting-System/frontend/node_modules/vinyl-fs/node_modules/graceful-fs/fs.js:1:37)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules/@nuxtjs/vuetify/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules/watchpack/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules/sass/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN @carbon/charts@0.34.11 requires a peer of d3@>=5.0.0 <=5.14.2 but none is installed. You must install peer dependencies yourself.
npm WARN vue2-leaflet@2.7.1 requires a peer of @types/leaflet@^1.5.7 but none is installed. You must install peer dependencies yourself.
npm WARN The package sass-loader is included as both a dev and production dependency.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! semantic-ui@2.4.2 install: `gulp install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the semantic-ui@2.4.2 install 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/supportuser/.npm/_logs/2022-02-25T19_58_54_396Z-debug.log

-- Found the following article reporting this error: https://stackoverflow.com/questions/55921442/how-to-fix-referenceerror-primordials-is-not-defined-in-node-js

In article, suggest install NodeJS v11. Attmpted to install NodeJS v11 on Ubuntu v20.04.3 though failed, instead installed v10.

Deployed application using following commands:

curl -fsSL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get -y install nodejs
npm cache clean --force
rm -fr node_modules/
rm -f package-lock.json
npm install
npm install fibers@5.0.0
npm i -S core-js@2.5.7
npm run serv

To Reproduce Steps to reproduce the behavior:

  1. Clone the github repo
  2. Change to the directory Incident-Accuracy-Reporting-System/frontend
  3. Run the command npm install
  4. See error

Expected behavior The commands npm install and npm run serve should complete without any errors.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

nitekon1 commented 2 years ago

Created new frontend UI, may be viewed at the following URL: http://limestone.austin.ibm.com

tracked under following git repo: https://github.ibm.com/cjohnso/react-carbon-dashboard

Please provide feedback.

nitekon1 commented 2 years ago

Front end has been rewritten in React + Carbon Design System, which now works in latest NodeJS LTS release. Closing out this issue.