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

Cannot find module #787

Open YuchengHappy opened 2 years ago

YuchengHappy commented 2 years ago

npm run build

hashlips_art_engine@1.1.1 build node index.js

node:internal/modules/cjs/loader:936 throw err; ^

Error: Cannot find module '../build/Release/canvas.node' Require stack:

Node.js v17.4.0 npm ERR! code 1 npm ERR! path /Users/luyucheng/Downloads/hashlips_art_engine-main npm ERR! command failed npm ERR! command sh -c node index.js

npm ERR! A complete log of this run can be found in: npm ERR! /Users/luyucheng/.npm/_logs/2022-02-22T00_51_42_118Z-debug.log

YuchengHappy commented 2 years ago

I don't know why this happened to me, I run the npm install canvas few times, but the bug keeps happening to me.

bolshoytoster commented 2 years ago

@YuchengHappy It's a problem with M1 macs, I think you can get around it by downgrading node to v14 and running npm i again.

YuchengHappy commented 2 years ago

@YuchengHappy It's a problem with M1 macs, I think you can get around it by downgrading node to v14 and running npm i again.

I tried with my older mac, indeed, it was due to the M1 chips problem.

kelvin-zhao commented 2 years ago

Downgrading to v14 node didn't fix it for me. Is there any workaround for M1 macs?

bolshoytoster commented 2 years ago

@kelvin-zhao what about 14.19.0?

kelvin-zhao commented 2 years ago

@bolshoytoster 14.19.0 worked! Thank you~

db-133 commented 2 years ago

@bolshoytoster 14.19.0 worked! Thank you~ Hello, im using Mac m1, downloaded 14.19.0 , npm 6.14.16. However, it still writes me " Error: Cannot find modules" thank you

bolshoytoster commented 2 years ago

@db-133 please paste the full error.

db-133 commented 2 years ago

umal@MacBook-Pro-Umalt hashlips_art_engine-1.1.2_patch_v6 % npm run build

hashlips_art_engine@1.1.1 build /Users/umal/Desktop/hashlips_art_engine-1.1.2_patch_v6 node index.js

internal/modules/cjs/loader.js:905 throw err; ^

Error: Cannot find module '/Users/umal/Desktop/hashlips_art_engine-1.1.2_patch_v6/node_modules/sha1' Require stack:

npm ERR! A complete log of this run can be found in: npm ERR! /Users/umal/.npm/_logs/2022-03-23T12_36_25_267Z-debug.log umal@MacBook-Pro-Umalt hashlips_art_engine-1.1.2_patch_v6 %

bolshoytoster commented 2 years ago

@db-133 run npm install.

db-133 commented 2 years ago

After I did this command, it says this v@mbp-umalt hashlips_art_engine-1.1.2_patch_v6 % npm install npm WARN hashlips_art_engine@1.1.1 No repository field.

audited 66 packages in 0.998s

6 packages are looking for funding run npm fund for details

found 0 vulnerabilities"

bolshoytoster commented 2 years ago

@db-133 I think it worked.

db-133 commented 2 years ago

after I do node index.js (node:14987) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, scandir '/Users/umal/Desktop/hashlips_art_engine-1.1.2_patch_v6/layers/Eyeball/' at Object.readdirSync (fs.js:1047:3) at getElements (/Users/umal/Desktop/hashlips_art_engine-1.1.2_patch_v6/src/main.js:73:6) at /Users/umal/Desktop/hashlips_art_engine-1.1.2_patch_v6/src/main.js:92:15 at Array.map () at layersSetup (/Users/umal/Desktop/hashlips_art_engine-1.1.2_patch_v6/src/main.js:90:30) at startCreating (/Users/umal/Desktop/hashlips_art_engine-1.1.2_patch_v6/src/main.js:356:20) at /Users/umal/Desktop/hashlips_art_engine-1.1.2_patch_v6/index.js:6:3 at Object. (/Users/umal/Desktop/hashlips_art_engine-1.1.2_patch_v6/index.js:7:3) at Module._compile (internal/modules/cjs/loader.js:1085:14) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10) (Use node --trace-warnings ... to show where the warning was created) (node:14987) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:14987) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

bolshoytoster commented 2 years ago

@db-133 save your src/config.js file.

db-133 commented 2 years ago

Bro, thank you so much. it worked!

Mkhuliseni commented 2 years ago

Hey please help am running into this problem when trying to compile my code code:internal/modules/cjs/loader:936 throw err; ^

Error: Cannot find module '/root/folder/hh-fcc/ethers-simple-storage/...' at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15) at Function.Module._load (node:internal/modules/cjs/loader:778:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) at node:internal/main/run_main_module:17:47 { code: 'MODULE_NOT_FOUND', requireStack: []

bolshoytoster commented 2 years ago

@Mkhuliseni what did you run to get that error?

Arulthas05 commented 2 years ago

at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15) at Function.Module._load (internal/modules/cjs/loader.js:746:27) at Module.require (internal/modules/cjs/loader.js:974:19) at require (internal/modules/cjs/helpers.js:101:18)

please help

bolshoytoster commented 2 years ago

@Arulthas05 can you please paste the FULL error here please.

R777R commented 1 year ago

Error: Cannot find module 'C:\Users\Ry\Documents\NEW\generative-art-opensource-main...' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15) at Function.Module._load (internal/modules/cjs/loader.js:746:27) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) at internal/main/run_main_module.js:17:47 { code: 'MODULE_NOT_FOUND', requireStack: [] }

bolshoytoster commented 12 months ago

@R777R it looks like the path was shortened on the first line, so I'll assume it can't find index.js. Try running cd generative-art-opensource-main first.