question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

LESS version mismatch

See original GitHub issue

Type of Issue

[x] Bug Report
[ ] Feature Request

Description

While converting an Angular 6 library to use ng-packagr, I received this error message:

Unable to interpret argument less-plugin-npm-import - if it is a plugin (less-plugin-less-plugin-npm-import), make sure that it is installed under or at the same level as less

The issue seems to be that ng-packagr requires less@^3.8.0, and my project was already using less@2.3.1. For processing LESS files, the stylesheet-processor.ts uses a direct path into node_modules/less/bin/lessc, which pointed to my project’s local less@2.3.1 package, not the expected less@^3.8.0. Since these two versions have slightly different methods for specifying plugins in CLI arguments, the process failed.

This bug could be avoided by including the expected version of less (currently less@^3.8.0) as a peer dependency.

Related: PR #1060

How To Reproduce

  1. Create an angular project using the ng new command
  2. Install a local dependency on less@2.3.1
  3. Generate a library with ng g library testlib
  4. Add a LESS stylesheet to the library
  5. Try to build the testlib library with ng build testlib

Expected Behaviour

The ng-packagr package should specify that it expects less@^3.8.0 to be installed as a peer dependency.

Version Information

$ node_modules/.bin/ng-packagr --version
ng-packagr:            4.7.1
@angular/compiler:     6.1.10
rollup:                0.67.4
tsickle:               0.32.1
typescript:            2.9.2

$ npm ls less
+-- @angular-devkit/build-angular@0.6.8
| `-- less@3.9.0
+-- less@2.3.1
`-- ng-packagr@4.7.1
  `-- less@3.9.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
JoostKcommented, May 9, 2019

@alan-agius4 I was just going to type that… 😛

0reactions
github-actions[bot]commented, Jun 19, 2020

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem. This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tired of version mismatch errors in package.json - Medium
Tired of version mismatch errors in package.json ? · MAJOR version is updated whenever there are major api changes in package which are...
Read more >
Fix Version Mismatch Error | Rocket League - YouTube
Want to play Rocket League, but can't connect to servers, join friends or play games because your game is showing the Version Mismatch...
Read more >
Version mismatch state for a managed system - IBM
The Version mismatch state can occur when the redundant or dual Hardware Management Consoles (HMCs) that manage the same server are at ...
Read more >
spurious version-mismatch error for packages that differ only ...
plugin: spurious version-mismatch error for packages that differ only in debug information #31278. Open. mem opened this issue on Apr ...
Read more >
SupportAssist Client v3.1 Version Mismatch Issue | Dell US
SupportAssist Client v3.1 may encounter a version mismatch error where either Appx is a higher version or the service is a higher version....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found