The solution to the problem that the HBuilderX development tool failed to install the less plug-in.

<style lang="less"></style>When using the HBuilderX development tool to develop the uniapp project, if you want to use this kind of code written in it , it means that lessthis preprocessor plug-in is used. If we do not install this plug-in, the following error will be reported when running the uniapp project:

Then you will definitely think of installing lessthe preprocessor plug-in, but unexpectedly the following error will be reported. This article is to solve the problem of failure to install the less plug-in. 

Solution:

Step 1: Find the location of the HBuilderX installation package, and then显示包内容

Step 2: Find compile-lessthe path and find that there is no less plug-in. There is only one important package.jsonfile in the directory, and the equally important node_modulesfolder is not found. This is the reason why the installation of the less plug-in fails.

Step 3: Open package.jsonthe file, which further proves that the dependency to be installed is indeed there less, and you only need to install it.

  • Step 4: Open the built-in terminal and switch to compile-lessthe directory
cd /Applications/HBuilderX.app/Contents/HBuilderX/plugins/compile-less

Step 4: Then execute sudo npm installor sudo cnpm installinstall lessdependencies

Step 5: I successfully saw node_modulesthe folder this time, indicating that the dependencies were successfully installed.

Step 5: Recompile, OK.

Guess you like

Origin blog.csdn.net/qq_42351675/article/details/130483247