Cannot find module ‘.. / lib / utils / unsupported. JS’ problem in installing node in centos7

When installing node in centos7 virtual machine, an error is reported: cannot find module ‘…/lib/utils/unsupported. JS’. The complete error is as follows:

the prompt is that an unsupported.js file cannot be found. Finally, it is found that the soft connection is wrong when installing this version of node in centos7, This problem may not be solved by re installation (at present, I only encounter this problem in the virtual machine of centos7). Delete the original NPM connection and re create one.

1. First, download the CD to the bin folder of the node version, where version 12.16.2 is installed

cd /opt/node-v12.16.2-linux-x64/bin

2. Delete the NPM file in the path, and enter yes when prompted

rm npm

3. Reestablish file connection

ln -s ../lib/node_modules/npm/bin/npm-cli.js ./npm

Using NPM – V command again, it is found that it is almost OK.
the whole operation is shown as follows:


Read More: