-
Notifications
You must be signed in to change notification settings - Fork 555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update documentation for using Crafty as a module #1197
Comments
Have you tried using it via the npm module? There's an example app you can look at here, though it's from a few versions ago. |
Theres not much info in the README, do I have to |
Also, installing $ npm i craftyjs
> [email protected] postinstall /Users/gingkathfox/node_modules/craftyjs
> (node -e "process.env.NODE_ENV !== 'production' && process.exit()" && grunt copy:lib) || node -v
A valid Gruntfile could not be found. Please see the getting started guide for
more information on how to configure grunt: http://gruntjs.com/getting-started
Fatal error: Unable to find Gruntfile.
v8.9.4
npm WARN saveError ENOENT: no such file or directory, open '/Users/gingkathfox/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/gingkathfox/package.json'
npm WARN acorn-dynamic-import@4.0.0 requires a peer of acorn@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.3.0 requires a peer of bufferutil@^3.0.3 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.3.0 requires a peer of erlpack@discordapp/erlpack but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.3.0 requires a peer of node-opus@^0.2.7 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.3.0 requires a peer of opusscript@^0.0.6 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.3.0 requires a peer of sodium@^2.0.3 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.3.0 requires a peer of libsodium-wrappers@^0.5.4 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.3.0 requires a peer of uws@^9.14.0 but none is installed. You must install peer dependencies yourself.
npm WARN gingkathfox No description
npm WARN gingkathfox No repository field.
npm WARN gingkathfox No README data
npm WARN gingkathfox No license field.
+ [email protected]
added 40 packages from 139 contributors and audited 11369 packages in 12.809s
found 177 vulnerabilities (77 low, 42 moderate, 54 high, 4 critical)
run `npm audit fix` to fix them, or `npm audit` for details |
$ npm audit
npm ERR! code EAUDITNOPJSON
npm ERR! audit No package.json found: Cannot audit a project without a package.json
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/gingkathfox/.npm/_logs/2018-12-02T16_21_49_339Z-debug.log |
This one looks like an issue with the package.config -- it's a step that's necessary when developing with crafty, but not when installing it as a module. It's getting run as a postinstall script, so even with the error it would normally mean that crafty had installed ok. However:
and
These errors look like you're trying to install crafty into a place that isn't set up as a node project. If you're in the folder for your project, you'll want to start by either creating a
All of the rendering methods assume assume some sort of DOM/html context. It's possible to build a headless version of crafty that could run in the context of a node server, but that doesn't sound like what you're going for. |
I think PR #1199 will fix the errors when you don't have grunt installed in the future. (But not until we release a new version on npm.) |
ok! |
I think the main issue here is that we need better docs on using Craft as a module, so updating the title to that. |
Hmmm, yeah, that's a better title XD |
@starwed the example app helped, thanks! i have another, completely different question though. Do you have a discord so we can chat? |
I'm helping develop a top-down game for desktop, so I need to use crafty as a module in VSCode. How can I do that? I don't see anything in the docs about this.
The text was updated successfully, but these errors were encountered: