Answer the question
In order to leave comments, you need to log in
Why did an error occur while using npm run build?
I want to try running this code on my computer and see how it works.
https://github.com/HashLips/generative-art-node
I downloaded the zip archive and unpacked it.
Moved to the directory with the folder.
cd C:\Downloads\generative-art-node-main\generative-art-node-main\
npm run build
> [email protected] build C:\Downloads\generative-art-node-main\generative-art-node-main
> node index.js
internal/modules/cjs/loader.js:892
throw err;
^
Error: Cannot find module 'canvas'
Require stack:
- C:\Downloads\generative-art-node-main\generative-art-node-main\src\main.js
- C:\Downloads\generative-art-node -main\generative-art-node-main\index.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
at Function.Module._load (internal/modules/cjs/loader. js:745:27)
at Module.require (internal/modules/cjs/loader.js:961:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object. (C:\Downloads\generative-art-node-main\generative-art-node-main\src\main.js:2:37)
at Module._compile (internal/modules/cjs/loader.js:1072:14 )
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module._load (internal/modules/cjs/loader.js:778:12)
at Module.require (internal/modules/cjs/loader.js:961:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Downloads \\generative-art-node-main\\generative-art-node-main\\src\\main.js',
'C:\\Downloads\\generative-art-node-main\\generative-art-node -main\\index.js'
]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `node index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Admin\AppData\Roaming\npm-cache\_logs\2021-09-27T11_51_58_474Z-debug.log
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question