twolfson / grunt-zip

Zip and unzip files via a grunt plugin
MIT License
87 stars 19 forks source link

Error: ENOENT, no such file or directory 'jszip/jszip.js' #14

Closed lc3t35 closed 11 years ago

lc3t35 commented 11 years ago

I use a gruntfile (https://github.com/xolvio/rtd/blob/master/Gruntfile.js) that load grunt-zip (works fine to unzip) but as i debug the script i notice the following messages :

{ [Error: ENOENT, no such file or directory 'jszip/jszip.js']
  errno: 34,
  code: 'ENOENT',
  path: 'jszip/jszip.js',
  syscall: 'open' }
{ [Error: ENOENT, no such file or directory 'jszip/jszip-deflate.js']
  errno: 34,
  code: 'ENOENT',
  path: 'jszip/jszip-deflate.js',
  syscall: 'open' }
{ [Error: ENOENT, no such file or directory 'jszip/jszip-inflate.js']
  errno: 34,
  code: 'ENOENT',
  path: 'jszip/jszip-inflate.js',
  syscall: 'open' }
{ [Error: ENOENT, no such file or directory 'jszip/jszip-load.js']
  errno: 34,
  code: 'ENOENT',
  path: 'jszip/jszip-load.js',
  syscall: 'open' }
. If i remove grunt.loadNpmTasks('grunt-zip'); from the script there is no error messages. npm ls output
─┬ grunt-zip@0.9.2
│ ├── grunt-retro@0.6.3
│ └── node-zip@0.0.2
twolfson commented 11 years ago

That is a strange bug indeed. I will try to look into this this week. For additional info, what version of node, grunt, and grunt-cli (if applicable) are you on?

twolfson commented 11 years ago

Hey @lc3t35, I cloned your repo and took a look inside. I needed to do some modifications to your Gruntfile.js to make things work. e.g. remove /../../ and /test/ from some locations, I was getting:

$ grunt
Loading "Gruntfile.js" tasks...ERROR
>> Error: Cannot find module '/home/todd/github/rtd/../../test/rtd/rtd.conf.js'
Warning: Task "default" not found. Use --force to continue.

After that, I ran grunt unzip and it seemed to work just fine.

$ grunt unzip
File "/home/todd/github/rtd/test/rtd/lib/bin/" created.

Done, without errors.

Can you try creating a smaller proof of concept Gruntfile.js which uses exclusively grunt-zip and no other configs to verify that other grunt-tasks are not conflicting with grunt-zip?

lc3t35 commented 11 years ago

Node 0.10.12, grunt-cli v0.1.9, grunt v0.4.1

You can use https://github.com/xolvio/real-time-development-with-meteor as a POC. The message are displayed in my WebStorm console when i debug with

node --debug /usr/local/bin/grunt --debug

(the message is not displayed if run as command line ...)

Current investigation shows that the error message is displayed when tasks.js loadTask:310 run

fn = require(path.resolve(filepath));

with filepath : /Users/laurent/dev/meteor/real-time-development-with-meteor/test/rtd/node_modules/grunt-zip/tasks/zip.js

twolfson commented 11 years ago

Alright, thanks. I will try another pass at this tonight or tomorrow.

twolfson commented 11 years ago

Taking a look now.

twolfson commented 11 years ago

Getting a strange error when running grunt

$ grunt
>> Error: Command failed:
Fatal error: Command failed: 

However, grunt unzip is working standalone

$ grunt unzip
File "/home/todd/github/real-time-development-with-meteor/test/rtd/../../test/rtd/lib/bin/" created.

Done, without errors.

When I say proof of concept, I mean a fresh project demonstrating only grunt-zip and no other configurations. This isolates the issue and verifies that it is grunt-zip having troubles on your machine or not. If you don't perform that, I am unable assist you further.

lc3t35 commented 11 years ago

Yes, unzip works fine -> these messages are displayed only when node is under debug mode, you should try to run

node --debug /usr/local/bin/grunt --debug unzip

chenjie-cnooc commented 11 years ago

when I try to debug grunt task with node-inspector & , I have an error. do fellow: 1.node --debug-brk \grunt build-task

  1. node-inspector & I receive a error "no such file or directory in grunt-cli\bin\node_modules\findup-sync.js " in chrome url:http://127.0.0.1:8080/debug?port=5858
twolfson commented 11 years ago

@chenjie-cnooc Are you working on the same project as @lc3t35 ?

twolfson commented 11 years ago

@lc3t35 You are not listening to me and therefore I cannot help you. This is the third time I have looked at your project and it is the same cluttered Gruntfile it was before.

I have run the task successfully with --debug

$ node --debug /usr/local/bin/grunt unzip
debugger listening on port 5858
Failed to open socket on port 5858, waiting 1000 ms before retrying
Failed to open socket on port 5858, waiting 1000 ms before retrying
Failed to open socket on port 5858, waiting 1000 ms before retrying
Failed to open socket on port 5858, waiting 1000 ms before retrying
Failed to open socket on port 5858, waiting 1000 ms before retrying
Failed to open socket on port 5858, waiting 1000 ms before retrying
Failed to open socket on port 5858, waiting 1000 ms before retrying
Failed to open socket on port 5858, waiting 1000 ms before retrying
File "/home/todd/github/real-time-development-with-meteor/test/rtd/../../test/rtd/lib/bin/" created.

Done, without errors.

If you run it with both debugs, I run into that Command failed: issue I had encountered before.

$ node --debug /usr/local/bin/grunt --debug unzip
debugger listening on port 5858
Failed to open socket on port 5858, waiting 1000 ms before retrying
Launching Selenium-server on port 4444
Launching Karma listener on port 9876
Launching Karma runner on port 9100
Launching Meteor on port 3000
Launching Mirror on port 8000
Waiting...>> Error: Command failed:
Fatal error: Command failed: 

If I run it with the grunt --debug flag, it works

$ grunt unzip --debug
Running "unzip:chromeDriver" (unzip) task
[D] Task source: /home/todd/github/real-time-development-with-meteor/test/rtd/node_modules/grunt-zip/tasks/zip.js
File "/home/todd/github/real-time-development-with-meteor/test/rtd/../../test/rtd/lib/bin/" created.

Done, without errors.

If I cannot isolate the issue because I cannot work with your Gruntfile, then I have no choice but to leave the problem on something wrong with your system.

I am closing the issue until you come back with a proof of concept.

lc3t35 commented 11 years ago

Thank you for your review. I understand you need a smaller POC, but i'm not able to provide such POC yet. chenjie-cnooc is not working with me.