nftchef / art-engine

An advanced fork of the HashLips Art Engine with additional features to generate complex art from provided layers using the familiar Hashlips setup.
MIT License
427 stars 203 forks source link

npm run rarity or yarn rarity Not working #189

Closed Roskaiu closed 1 year ago

Roskaiu commented 2 years ago

I followed the instructions of https://generator.nftchef.dev/utils/rarity

When I want to execute npm run rarity

That's all I need to get my collection ready.

Thank you

jjclay commented 2 years ago

I think I had the same problem. If you look in the code there is no rarity.js, only rarityData.js (which errors out for me). I think that I copied rarity.js from the original hashlips repo. I got errors regarding csv and the NFTChef provided the fix here: https://github.com/nftchef/art-engine/discussions/146#discussion-4017751

Roskaiu commented 2 years ago

Thank you! I'll give that a try

buhduhzah commented 2 years ago

this worked for me! it prints a log node utils/rarityData.js > rarity.log 2>&1

Roskaiu commented 2 years ago

I'm getting this error, any ideas? this is all I need to finish. Thank you very much a

buhduhzah commented 2 years ago

i forgot that i had runnpm install --save csv-writer maybe that would help? hopefully someone else knows, i'm more of a copy-paste coder

Roskaiu commented 2 years ago

image

// Thank you very much for your interest but didn't work.

npm WARN nft-kitchen-sink-generator@2.0.2 No repository field

// We were able to get all the utilities working. It would only remain the list of rarities to have the project ready.

I hope to be able to solve this. if someone can give me a clue where the error may be. I will be very grateful.

juanicarmesi commented 2 years ago

Hi what worked for me was to download the rarity.js file from https://github.com/nftchef/art-engine/tree/utils/rarity/utils into the utils folder.

Then in the package.json file add a line in the "scripts" set with "rarity": "node utils/rarity.js" it will look like this:

"scripts": {
    "build": "node index.js",
    "generate": "node index.js",
    "generate:solana": "node index.js && node utils/metaplex.js",
    "generate:cardano": "node index.js && node utils/cardano.js",
    "generate:tezos": "node index.js && node utils/tezos.js",
    "preview": "node utils/createPreviewCollage.js",
    "gif": "node utils/preview_gif.js",
    "update:metadata": "node utils/updateInfo.js",
    "update_info:tezos": "node tezos/updateInfo.js",
    "resize": "node utils/resize.js",
    "test": "echo \"Error: no test specified\" && exit 1",
    "rarity": "node utils/rarity.js"
  },

Hope it helps!

ghost commented 2 years ago

The script exists on a different branch called utils/rarity. So to use it I did:

  1. Checkout the main branch nested-folder-structure
  2. Generate the images by running npm run build
  3. Switch to the branch utils/rarity
  4. In terminal call npm run rarity. Note: You may get an error about csv-writer package and need to install it. I did it with npm i csv-writer
  5. A csv is generated called _rarity.csv. Open it with any spreadsheet software

Hope that helps!