Unable to locate a compatible version for the email address [email protected]

I'm facing a dilemma while working on a lerna project that utilizes npm. I am unsure whether the issue lies within the lerna setup or npm itself.

The project structure is organized as follows:

- package.json (root)
- package-lock.json
- lerna.json
- packages/
  - main-package/
    - package.json
    - package-lock.json
    - ...
  - aux-package/
    - package.json
    - package-lock.json
    - ...

Within main-package/package.json, there exists a localPeerDependencies declaration:

"localPeerDependencies": {
    "aux-package": "0.0.0-0",
    ...
  }

The version field of aux-package aligns with this specified value.

In the directory of main-package, the build script runs smoothly and everything functions correctly. However, after altering the code to eliminate the need for aux-package as a dependency, attempting to delete the peerLocalDependencies entry through npm remove aux-package results in the following error:

npm ERR! code ETARGET
npm ERR! notarget No matching version found for <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a2c3d7da8fd2c3c1c9c3c5c7e2928c928c928f92">[email protected]</a>.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

Executing npm prune yields the same error message.

One possible solution could involve manually deleting the pertinent entries in package.json, package-lock.json, followed by removing the node_modules folder and then reinstalling. Nonetheless, my objective is to gain deeper insights into the root cause of the problem.

Firstly, should I attribute this issue to lerna or npm? Secondly, what constitutes the best practice for uninstalling packages listed in localPeerDependencies in the year 2023?

Your guidance and advice on this matter would be greatly appreciated!

Answer №1

It appears that in the 'main-package' directory, there was a discrepancy between package.json, package-lock.json, and node_modules/.package-lock.json which caused the error to occur.

To resolve this issue, I had to execute the following commands once to restore the proper connections:

rm -rf node_modules #at the top level of main-package

lerna link #at the root of the project

npm install # at the main-package directory

After that, everything seemed to be working smoothly.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Is there a way to retrieve bookmarks (TOC) from a PDF document using technologies such as NodeJS, ReactJS, or PHP?

I'm sure most people have noticed that when you open a PDF in the browser or Acrobat PDF reader, a bookmarks tab appears like the one shown here: https://i.stack.imgur.com/obFer.png If the PDF doesn't have any bookmarks, the list will be empty. ...

Laravel has not been properly initialized

Recently, I've been exploring Laravel 5.3 and vue.js and I'm trying to make a GET request to fetch some user data from my database. I'm utilizing components in this project. Here is a snippet from my app.js file: require('./bootstrap ...

Having issues with setting up Spatie on a Windows system

I've been working on setting up Spatie/Browsershot for my Laravel project, but even after following all the necessary steps, I keep encountering an error: 'node' is not recognized as an internal or external command, operable program or batc ...

Containerize your Laravel/VueJS application using Docker

My goal is to dockerize my Laravel application, and I have come across various tutorials that seem helpful: Tutorial 1 Tutorial 2 Tutorial 3 Tutorial 4 In my development Dockerfile, I have defined the necessary steps for setting up the environment. Ho ...

Implementing an npm-installed package in Laravel: A step-by-step guide

Apologies for the newbie question, but I'm completely new to package management systems, especially npm. Normally, I just link my CSS/Scripts to CDNs. However, I am currently working on a Laravel app that requires a more advanced <select> eleme ...

Guide to setting up npm pug-php-filter in conjunction with gulp

I'm having trouble setting up pug-php-filter (https://www.npmjs.com/package/pug-php-filter) with gulp in order to enable PHP usage in my Pug files. Any assistance would be greatly appreciated. ...

Localhost is causing issues with Laravel in retrieving webfonts

I was trying to incorporate font-awesome into my Laravel project, but encountered a strange error. When I run the project, the following error appears in the console: GET http://localhost/fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.woff2?5 ...

Can composer be used to verify if npm is installed on the system?

Currently working on a composer file, verifying the presence of both imagick and mysql. Additionally, I am interested in determining if npm is installed on the system. Is there a way to confirm this? Appreciate any guidance. ...

Is there a similar feature to npm link in composer for PHP projects?

During my JavaScript module development process, I utilize npm link to easily install my local version into projects that require the module as a dependency. This method provides a seamless workflow. Although not quite as ideal as TDD, this approach simpl ...

Is there a way to precompile jade.php templates efficiently?

I've developed strong feelings for Jade, and can't bear to see her anymore, but now I have a WordPress theme to design. So, I utilize Codekit, and it works well with jade - is there a way to incorporate jade.php instead of the node module? (I co ...