Jenkins uses NPM to build Vue error, and the manual build is normal

Error reporting scenario

Jenkins uses NPM to build Vue. The front end reports an error, and the manual build is normal

Error reporting, such as

Treating warnings as errors because process.env.CI = true.
Most CI servers set it automatically.

Failed to compile.
src/api/api.js
  Line 2:8:  'React' is defined but never used  no-unused-vars

src/api/attestation/index.js
  Line 2:8:  'qs' is defined but never used  no-unused-vars

src/api/query/index.js
  Line 2:8:  'qs' is defined but never used  no-unused-vars
...

resolvent

# Adding variables
export CI=false
npm install 

Link:

https://stackoverflow.com/questions/62663451/treating-warnings-as-errors-because-process-env-ci-true-failed-to-compile

Read More: