HashLips / hashlips_art_engine

HashLips Art Engine is a tool used to create multiple different instances of artworks based on provided layers.
MIT License
7.18k stars 4.3k forks source link

I've got an error while running node "utils/nftport/uploadFiles.js" #1353

Open ionutdarius11 opened 2 years ago

ionutdarius11 commented 2 years ago

node utils/nftport/uploadFiles.js C:\Users\adria\Desktop\hashlips_art_engine-1.1.2_patch_v6\utils\nftport\uploadFiles.js:2 const fetch = require('node-fetch'); ^

Error [ERR_REQUIRE_ESM]: require() of ES Module C:\Users\adria\Desktop\hashlips_art_engine-1.1.2_patch_v6\node_modules\node-fetch\src\index.js from C:\Users\adria\Desktop\hashlips_art_engine-1.1.2_patch_v6\utils\nftport\uploadFiles.js not supported. Instead change the require of index.js in C:\Users\adria\Desktop\hashlips_art_engine-1.1.2_patch_v6\utils\nftport\uploadFiles.js to a dynamic import() which is available in all CommonJS modules. at Object. (C:\Users\adria\Desktop\hashlips_art_engine-1.1.2_patch_v6\utils\nftport\uploadFiles.js:2:15) { code: 'ERR_REQUIRE_ESM' }

bolshoytoster commented 2 years ago

@ionutdarius11 https://github.com/codeSTACKr/create-10k-nft-collection/blob/main/README.md#es-module-error-err_require_esm

ionutdarius11 commented 2 years ago

@bolshoytoster ok so I ran the commands but now this appears:

C:\Users\adria\Desktop\hashlips_art_engine-1.1.2_patch_v6\utils\nftport\uploadFiles.js:6 fs.readdirSync(${basePath}/build/images).forEach(file => { ^

ReferenceError: basePath is not defined at Object. (C:\Users\adria\Desktop\hashlips_art_engine-1.1.2_patch_v6\utils\nftport\uploadFiles.js:6:19) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) at node:internal/main/run_main_module:17:47 PS C:\Users\adria\Desktop\hashlips_art_engine-1.1.2_patch_v6>

and also all my layer names in the config.js are matching the layer folder names

bolshoytoster commented 2 years ago

@ionutdarius11 add const basePath = process.cwd(); to the start of utils/nftport/uploadFiles.js

ionutdarius11 commented 2 years ago

it worked but only some of the files are updated and the rest are errors:

error:TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined

bolshoytoster commented 2 years ago

@ionutdarius11 can you please open an issue where you actually got the code.

ionutdarius11 commented 2 years ago

what code? sorry,I can't really understand what you meant

bolshoytoster commented 2 years ago

@ionutdarius11 this repo is hashlips' original code, you got the code you're running from codeSTACKr's repo, you should open an issue there instead.

ionutdarius11 commented 2 years ago

got it.

ionutdarius11 commented 2 years ago

well I tried opening the issue but I can only post a bug. Nobody would help me and Idk what to do. the errors are error:TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined

OR

error:FetchError: invalid json response body at https://api.nftport.xyz/v0/files reason: Unexpected token < in JSON at position 1

I really don't know what to do or what's the problem. Could you please help me?

bolshoytoster commented 2 years ago

@ionutdarius11 according to this comment it might be fixed by using the latest version of the repo.

ionutdarius11 commented 2 years ago

well it looks like the comment is from february. So..should I download the version from that month?

bolshoytoster commented 2 years ago

@ionutdarius11 no, just get the most recent one.

ionutdarius11 commented 2 years ago

I think I already have the newest version installed. Isn't it v14.18.2?

bolshoytoster commented 2 years ago

@ionutdarius11 here's a link to the current version.

ionutdarius11 commented 2 years ago

@bolshoytoster I'm gonna check it out tomorrow. Thanks for all your help. I may be back:)))

ionutdarius11 commented 2 years ago

@bolshoytoster so I checked on stackoverflow this issue https://stackoverflow.com/questions/60234640/typeerror-err-invalid-arg-type-the-path-argument-must-be-of-type-string-re and I think the problem is that I ran the "npm audit fix" command. Can I undo it somehow?

bolshoytoster commented 2 years ago

@ionutdarius11 that error is unrelated since it's about react, but you could try deleting the node_modules/ folder and running npm install again.

ionutdarius11 commented 2 years ago

@bolshoytoster deleting it and reinstalling did not make any change. Still lots of errors :///

bolshoytoster commented 2 years ago

@ionutdarius11 well there's nothing I can do to help if codeSTACKr's fork has been abandoned. You'll have to find another way to upload your images.