bowerfakerbower-install

Bower unable to install Faker@3.1.0


We have an old ember app has bower.json with below configuration:

{
  "name": "my-app",
  "dependencies": {
    "Faker": "~3.1.0"
  }
}

It has been working for years, recently we found the below error in building

bower install
bower Faker#~3.1.0          not-cached https://github.com/Marak/Faker.js.git#~3.1.0
bower Faker#~3.1.0             resolve https://github.com/Marak/Faker.js.git#~3.1.0
bower Faker#~3.1.0        ENORESTARGET No tag found that was able to satisfy ~3.1.0

Additional error details:
No versions found in https://github.com/Marak/Faker.js.git

I checked https://github.com/Marak/Faker.js, the error is right. There is no 3.1.0 anymore, the current version is 6.6.6. But the git commit history cannot find 3.1.0 version anymore.

Is there a way for me to find the 3.1.0 back from somewhere? It seems the author clears the old versions?


Solution

  • As explained in What happened with faker.js, the library's original maintainer erased the whole history of the repository. Older versions of Faker are still available via npm install; resolving them from the NPM registry is stable, as they prevent popular packages being unpublished since the left-pad debacle. However the tags no longer exist in the GitHub repository, hence Bower cannot find the package.

    There is a community-maintained fork of faker.js that you could switch to, even though new Bower packages cannot be created. Per the Bower documentation:

    As Bower is deprecated, registering new Bower packages is not supported anymore. Neverthless you can install any GitHub repository as Bower package by putting full name in bower.json:

    {
      "dependencies": {
        "angular-cli": "angular/angular-cli#^9.1.3"
      }
    }
    

    You can install any dependency from github with CLI as well:

    bower install angular/angular-cli --save
    

    In your case, therefore, you should be able to resolve the issue as follows:

    {
      "name": "my-app",
      "dependencies": {
        "Faker": "faker-js/faker#~3.1.0"
      }
    }