Skip to content
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

npm run images error #44

Closed
jorisgraat opened this issue Nov 3, 2020 · 4 comments
Closed

npm run images error #44

jorisgraat opened this issue Nov 3, 2020 · 4 comments

Comments

@jorisgraat
Copy link

jorisgraat commented Nov 3, 2020

npm run images

[10:12:51] Using gulpfile ~/sites/kerstactie-2020/gulpfile.js
[10:12:51] Starting 'images'...
[10:12:51] Starting ''...
[10:12:51] '' errored after 8.22 ms
[10:12:51] ReferenceError: connect is not defined
at /Users/joris/sites/kerstactie-2020/gulpfile.js:37:11
at bound (domain.js:427:14)
at runBound (domain.js:440:12)
at asyncRunner (/Users/joris/sites/kerstactie-2020/node_modules/async-done/index.js:55:18)
at processTicksAndRejections (internal/process/task_queues.js:79:11)
[10:12:51] 'images' errored after 10 ms
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! DuckHunt-JS@3.1.0 images: gulp images
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the DuckHunt-JS@3.1.0 images script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

@jorisgraat
Copy link
Author

@MattSurabian Hi! Is it possible for you to take a look? Thanks!

@Ellarddekoeijer
Copy link

I believe that in the future you can do this to get it working.
npm i gulp-connect --save
and then add
var connect = require('gulp-connect');
to the gulpfile.js

note that you need to have TexturePacker running locally, it should be able to run from anywhere so add it to your path

@IAluI
Copy link

IAluI commented Dec 4, 2020

@jorisgraat

  1. install TexturePacker https://www.codeandweb.com/texturepacker/download
  2. add path to folder with TexturePacker.exe to environment variable "Path" (in other system you must do similar operation, ask google about it)
  3. rewrite task 'images':
gulp.task('images', shell.task([
  'TexturePacker --version || echo ERROR: TexturePacker not found, install TexturePacker',
  'TexturePacker --disable-rotation --data dist/sprites.json --format json --sheet dist/sprites.png src/assets/images'
]));
  1. profit!

@MattSurabian
Copy link
Owner

MattSurabian commented Dec 4, 2020

Thanks again to awesome community members @IAluI and @Ellarddekoeijer! Sorry I have been delayed on this one @jorisgraat. I have just pushed a patch that should fix this 9a934de

A small nitpick in the recommendations above is that this should be a dev dependency not a runtime one, so the correct command to run would be npm i gulp-connect --save-dev. Now that it's added to package json though folks shouldn't have to think about it and this will "just work" going forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants