Copy node causes NPM execution error: cannot find module ‘/ / lib / utils/ unsupported.js ‘

Copy node causes NPM execution error: Cannot find Module ‘.. /lib/utils/unsupported.js’

    execute NPM –version command times error, as follows
[exec] Error: Cannot find module '../lib/utils/unsupported.js'
[exec] Require stack:
[exec] - /home/jenkins/workspace/324970/eis-product/eis-ui/eis-ui-app-pc/node-exelib/bin/npm
[exec]     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
[exec]     at Function.Module._load (internal/modules/cjs/loader.js:864:27)
[exec]     at Module.require (internal/modules/cjs/loader.js:1044:19)
[exec]     at require (internal/modules/cjs/helpers.js:77:18)
[exec]     at /home/jenkins/workspace/324970/eis-product/eis-ui/eis-ui-app-pc/node-exelib/bin/npm:19:21
[exec]     at Object.<anonymous> (/home/jenkins/workspace/324970/eis-product/eis-ui/eis-ui-app-pc/node-exelib/bin/npm:153:3)
[exec]     at Module._compile (internal/modules/cjs/loader.js:1158:30)
[exec]     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
[exec]     at Module.load (internal/modules/cjs/loader.js:1002:32)
[exec]     at Function.Module._load (internal/modules/cjs/loader.js:901:14) {
[exec]   code: 'MODULE_NOT_FOUND',
[exec]   requireStack: [
[exec]     '/home/jenkins/workspace/324970/eis-product/eis-ui/eis-ui-app-pc/node-exelib/bin/npm'
[exec]   ]
[exec] }
[exec] Result: 1
    after verification, normally NPM is a soft connection, but through zip packaging, and then decompressed NPM becomes the actual contents of the npm-cli.js file, so no responsive module can be found when executing the script. Solution: You can use the tar command to package.

Normal conditions:

total 45148
-rwxr-xr-x 1 1001 1001 46228688 Feb 18 12:35 node
lrwxrwxrwx 1 1001 1001       38 Feb 18 12:35 npm -> ../lib/node_modules/npm/bin/npm-cli.js
lrwxrwxrwx 1 1001 1001       38 Feb 18 12:35 npx -> ../lib/node_modules/npm/bin/npx-cli.js
lrwxrwxrwx 1 1001 1001       35 Mar  2 17:51 vuepress -> ../lib/node_modules/vuepress/cli.js 

Abnormal conditions (after decompression by ZIP compression) :

total 45164
-rwxr-xr-x 1 root root 46228688 Mar  2 17:53 node
-rwxr-xr-x 1 root root     4615 Mar  2 17:53 npm
-rwxr-xr-x 1 root root      177 Mar  2 17:53 npx
-rwxr-xr-x 1 root root      713 Mar  2 17:53 vuepress

Read More: