To facilitate development, I packaged a CLI library and added an NPM command:

"bin": {
    "my-vue-cli-service": "./bin/my-vue-cli-service.js"
  },
Copy the code

./bin/my-vue-cli-service.js contents are as follows:

#! /usr/bin/env node

require('@vue/cli-service/bin/vue-cli-service.js');
Copy the code

Jenkins: No such file or directory: No such file or directory: Jenkins: No such file or directory: No such file or directory

Sh -c my-vue-cli-service

Manually run sh -c my-vue-cli-service on Linux (my-vue-cli-service through the soft chain, Sh -c my-vue-cli-service.js (my-vue-cli-service.js); It was found that the file (my-vue-cli-service.js) newline mode is CRLF, change the file newline mode to LF, it is normal 😂

Little knowledge:

  • Why is the script header added#! /usr/bin/env node

When the system sees this line, it will first look up the node installation path in the env setting, and then call the node program in the corresponding path to execute the script.