A workaround that Npmlog cannot find in NPM in Linux

Source: Internet
Author: User

? A workaround that Npmlog cannot find in NPM in Linux

Describe

Today, when a server migration to the NODEJS project is performed, the NPM-V command is entered on the new Linux server and the error "Cannot find module ' npmlog ' ..." is reported. The reason for this is that the copy of the past bin directorynpmFile is not linked to the module directorynpm-cli.jsFile, so results in executingnpm -vcommand, the path problem causesnpmlogModule could not be found.

Workaround

There are two workarounds, one is to delete the NPM file under the Bin directory and link to it with the following command npm-cli.js .

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

After the experiment found, in the server decompression NODEJS official website downloaded compiled compressed package, and then copy the extracted files to the server, the bin npm is not linked to npm-cli.js .

The second way is to download the goodnode-v0.10.33-linux-x64.tar.gzThe compressed package is first placed on the server and then decompressed, at which pointnpmis already linked tonpm-cli.jsOf

See the command line as shown below for success.

12345
[[email protected] bin]# llNPM-. /lib/node_modules/npm/bin/npm-cli.js[[email protected] bin]#./npm-vV1.4.26

The reasons for these two copies of the different circumstances are unknown and need to be studied.

Article Foreverpx
Article source link: In Linux, NPM appeared npmlog found a workaround

A workaround that Npmlog cannot find in NPM in Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.