Tag Archives: less

error: Vue Project lang=“less“ Error [How to Solve]

Error reason:

The version of the less-loader is too high. Uninstall and reinstall version 7.0

1. Install the less-loader command: npm install — save dev less loader less

Solution:

1. Uninstall command: npm uninstall — save less loader

2 The command to install version 7.0: npm install – D [email protected]

After executing the above command, continue to check the less-loader and less versions in the package.json file, the less-loader version has been reduced to 7.X. Just re-run the project without errors. If the version has not changed after installation, you need to manually change the less-loader and less versions in the package.json file to version 7.0

[Solved] Input error: this. Getoptions is not a function

Reproduction steps:

1. The project was created using Vue cli

2. Install less4 x, less-loader10.X development dependency

3. After using lang = “less” in the single file Vue component, the compilation error is found, syntax error: typeerror: this getOptions is not a function

Reason: the version of less loader is too high. Uninstall and reinstall

// uninstall less
npm uninstall less-loader
npm uninstall less

// re-install less3.5.0、less-loader7.3.0
npm i -D [email protected]
npm i -D [email protected]

Vue Install less Error: While resolving: [email protected]

Vue Install  less Error: While resolving: [email protected]

F:\Workspace\project\hhhs\wudslyh5\big-data\hblvbigdata>npm install less less-loader --save-dev
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/webpack
npm ERR!   peer webpack@"^4.0.0" from @intervolga/[email protected]
npm ERR!   node_modules/@intervolga/optimize-cssnano-plugin
npm ERR!     @intervolga/optimize-cssnano-plugin@"^1.0.5" from @vue/[email protected]
npm ERR!     node_modules/@vue/cli-service
npm ERR!       peer @vue/cli-service@"^3.0.0 || ^4.0.0-0" from @vue/[email protected]
npm ERR!       node_modules/@vue/cli-plugin-babel
npm ERR!         dev @vue/cli-plugin-babel@"~4.5.0" from the root project
npm ERR!       4 more (@vue/cli-plugin-eslint, @vue/cli-plugin-router, ...)
npm ERR!   peer webpack@"^4.0.0 || ^5.0.0" from @soda/[email protected]
npm ERR!   node_modules/@soda/friendly-errors-webpack-plugin
npm ERR!     @soda/friendly-errors-webpack-plugin@"^1.7.1" from @vue/[email protected]
npm ERR!     node_modules/@vue/cli-service
npm ERR!       peer @vue/cli-service@"^3.0.0 || ^4.0.0-0" from @vue/[email protected]
npm ERR!       node_modules/@vue/cli-plugin-babel
npm ERR!         dev @vue/cli-plugin-babel@"~4.5.0" from the root project
npm ERR!       4 more (@vue/cli-plugin-eslint, @vue/cli-plugin-router, ...)
npm ERR!   19 more (@vue/cli-plugin-babel, @vue/cli-plugin-eslint, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev less-loader@"*" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/webpack
npm ERR!   peer webpack@"^5.0.0" from [email protected]
npm ERR!   node_modules/less-loader
npm ERR!     dev less-loader@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\Administrator\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Local\npm-cache\_logs\2021-11-30T09_15_59_630Z-debug.log

Solution:

Error reason: the installed version is too high

Solution:

Delete the previous version: NPM uninstall less loader download the specified version: NPM install less- [email protected] -D

If an error is still reported, the file node_Modules can be removed, Download NPM install again

Syntax Error: Error: Cannot find module ‘less‘ [How to Solve]

Question: syntax error: error: cannot find module ‘less’

Cause: the installed version of less loader does not match that of less

pay more attention to warnings during installation to avoid this problem.
there is a prompt during installation. You must install the corresponding less version for use with

Solution: install the corresponding version (pay more attention to warnings in the future)

An error is reported when the less file is introduced into main.js

Today, in a Vue project, I planned to modify the theme of vant, and then an unexpected error occurred. I introduced the less file into main.js, and an error was reported when the project was started.

After looking for the reason, I didn’t find out. Then I tried on the previous old project. From here, I can know that it must be the reason for the version of something. Finally, I found that it is the scaffolding. The new version of Vue cli has helped us configure the less loader and put it in util.js, We just need to modify the webpack.base.conf.js file under the build file, delete or comment out this code, and the project can run normally.

[Solved] Less Install Error: TypeError: this.getOptions is not a function

Project scenario:

use less development file


Problem Description:

less installation error

 Failed to compile with 1 error 
 Syntax Error: TypeError: this.getOptions is not a function

Cause analysis:

the current version does not match the less and less loader versions, and the less loader version needs to be replaced </ font>


Solution:

Install less version 4.1.1 and less loader version 7.3.0

<style scoped lang="less">
.wrapper{
	.header{...}
	.content{...}
}
</style>

Solve the problem that the version of less is too high

Implementation  npm install --save less less-loader

After installing less, error will be reported when using less in style

This situation is caused by the over high version of less loader. You can check the current version of less in package.json
to find out  

Therefore, in view of this situation, we can first uninstall the existing less loader, and then install the lower version of less loader
NPM install
NPM install [email protected] –save
 
Run it again

Solution to inaccessibility of Vue cli scaffold project after startup

The problem is as follows: the IP address cannot be accessed

Enter the file “project name – config”- index.js ”Open index.js File, modify parameter

after modification, it can be accessed normally:

If my article is helpful to you, welcome to like, leave a message and pay attention to it. Thank Sanlian!!!
The problem has not been solved!!! 😘😘😘

CSDN: I heard that you are good at playing
GitHub: zhongzhimao
Coupons: coupons