SAP / ui5-tooling

An open and modular toolchain to develop state of the art applications based on the UI5 framework
https://sap.github.io/ui5-tooling
Apache License 2.0
466 stars 71 forks source link

Cannot pass whitesource #288

Closed 29Esther closed 3 years ago

29Esther commented 4 years ago

Expected Behavior

npm ls without errpr

Current Behavior

many errors

Steps to reproduce the issue

  1. npm install
  2. npm ls

Context

Affected components (if known)

I tested. 'npm ls' is fine with ui5-server@1.1.1, so the problem is introduced by ui5-cli only.

Log Output / Stack Trace

npm ERR! extraneous: ava@2.4.0 /project/node_modules/@ui5/cli/node_modules/ava
npm ERR! extraneous: coveralls@3.0.9 /project/node_modules/@ui5/cli/node_modules/coveralls
npm ERR! extraneous: cross-env@6.0.3 /project/node_modules/@ui5/cli/node_modules/cross-env
npm ERR! extraneous: docdash@1.1.1 /project/node_modules/@ui5/cli/node_modules/docdash
npm ERR! extraneous: eslint@6.7.2 /project/node_modules/@ui5/cli/node_modules/eslint
npm ERR! extraneous: eslint-config-google@0.14.0 /project/node_modules/@ui5/cli/node_modules/eslint-config-google
npm ERR! extraneous: eslint-plugin-jsdoc@15.12.2 /project/node_modules/@ui5/cli/node_modules/eslint-plugin-jsdoc
npm ERR! extraneous: execa@3.4.0 /project/node_modules/@ui5/cli/node_modules/execa
npm ERR! extraneous: nyc@14.1.1 /project/node_modules/@ui5/cli/node_modules/nyc
npm ERR! extraneous: open-cli@5.0.0 /project/node_modules/@ui5/cli/node_modules/open-cli
npm ERR! extraneous: sinon@7.5.0 /project/node_modules/@ui5/cli/node_modules/sinon
npm ERR! extraneous: tap-nyan@1.1.0 /project/node_modules/@ui5/cli/node_modules/tap-nyan
npm ERR! extraneous: tap-xunit@2.4.1 /project/node_modules/@ui5/cli/node_modules/tap-xunit

This issue is very critical for SAP internal team as all the code needs to pass whitesource check.

RandomByte commented 4 years ago

Thanks for reporting! I suspect this to be an npm bug. All dependencies listed as in the error message are devDependencies and shouldn't be installed at all. This makes the "extraneous" error correct. Still I don't understand why they are installed in the first place.

I was able to reproduce this by executing npm install @ui5/cli in a new directory with nothing but an initial package.json. This installs 962 packages.

I observed that the generated package-lock.json lists the beforementioned devDependencies as non-dev dependencies. I then tried to execute npm install --no-package-lock @ui5/cli, which only installs 455 packages, correctly ignoring any devDependencies.

yarn install did not show this behavior.

I think this needs to be checked with the npm CLI team.

Anyways, I highly recommend you to use a package-lock.json in your project and to use npm ci in your CI environment.

29Esther commented 4 years ago

Hi @RandomByte , Thanks for your instants reply. I added a package-lock.json in our application. Then I can pass the npm ls now.