Skip to content
This repository has been archived by the owner on Apr 11, 2022. It is now read-only.

Windows: Cannot find script file "C:\res\windows\zip.js" #81

Closed
mwbrooks opened this issue Jul 2, 2013 · 29 comments
Closed

Windows: Cannot find script file "C:\res\windows\zip.js" #81

mwbrooks opened this issue Jul 2, 2013 · 29 comments
Labels

Comments

@mwbrooks
Copy link
Collaborator

mwbrooks commented Jul 2, 2013

Operating System

  • Windows 7
  • Windows 8

Environment

  • Command Prompt
  • Git Bash

Command

C:\Development\my-app> phonegap remote run android
or
$ phonegap run android

Error

A dialog box saying: Cannot find script file "C:\res\windows\zip.js"

@mwbrooks
Copy link
Collaborator Author

mwbrooks commented Jul 2, 2013

Reference

#77 uncovered this issue.

@red2678
Copy link

red2678 commented Jul 2, 2013

Thanks @mwbrooks. I can confirm the zip error message on remote build.

C:\myApp>phonegap remote build android
  phonegap  compressing the app...
     error  failed to create the zip file: C:\myApp\build\www.zip

C:\myApp>

I also get this zip error on a local run/build as well.

C:\myApp>phonegap run android
  phonegap  detecting Android SDK environment...
  phonegap  using the remote environment
  phonegap  compressing the app...
     error  failed to create the zip file: C:\myApp\build\www.zip

C:\myApp>

Two things to note...

  1. I am running my command prompt as Admin
  2. I do not have a "build" folder in my directory structure created by the CLI.
    • so C:\myApp\build\ <-- does not exist.

Not sure if the run process creates that folder for me......

@mwbrooks
Copy link
Collaborator Author

mwbrooks commented Jul 2, 2013

Awesome, I'm glad you're seeing the same error as me. The above commit should address that error message.

However, I am now seeing a new error. I am curious whether the new error is Windows 8 specific or happening on Windows 7. Would you mind testing it on your system?

screen shot 2013-07-02 at 4 05 47 pm

The latest fix is available on npm as phonegap@2.9.0-0.12.5.

You can update to the latest version by running:

C:\>npm install -g phonegap

@red2678
Copy link

red2678 commented Jul 2, 2013

Dam you are quick!

Confirmed:

err

Also, just so you know, I now do not get the error on a local run:

C:\myApp>phonegap local run android
  phonegap  adding the Android platform...
     error  undefined

C:\myApp>

@mwbrooks
Copy link
Collaborator Author

mwbrooks commented Jul 2, 2013

Awesome, thanks for confirming that.

Alright, I guess I'm going to have to learn some Windows Script Host syntax 😣

That error undefined is a side-effect of another patch from today. The error message is suppose to be scrapped from the console output. However... since Windows pops up an alert box... there is no output to grab. I'll patch that with a default error of failed to create zip file: <path>.

@mwbrooks
Copy link
Collaborator Author

mwbrooks commented Jul 2, 2013

ping @bennmapes - any leads on what that error message is about? It looks like NameSpace() is not defined, but objShell is.

@mwbrooks
Copy link
Collaborator Author

mwbrooks commented Jul 3, 2013

Update:

@bennmapes I think I've figured out the WScript and fixed the thrown issue. I'll get you to review the code once it's reimplemented.

@bennmapes
Copy link

Awesome, sounds good.

@mwbrooks
Copy link
Collaborator Author

mwbrooks commented Jul 3, 2013

I've logged this issues as phonegap/node-phonegap-build#39

mwbrooks added a commit that referenced this issue Jul 3, 2013
@mwbrooks
Copy link
Collaborator Author

mwbrooks commented Jul 3, 2013

Published on npm as phonegap@2.9.0-0.12.6

@red2678 would you mind giving it a try on your end? Thanks.

@mwbrooks mwbrooks closed this as completed Jul 3, 2013
@red2678
Copy link

red2678 commented Jul 3, 2013

BOOM! @mwbrooks @bennmapes

You guys rock. I owe you both a beer (or a few). Hope to see you at PhoneGap day 2013!

Thanks,

~Anthony

Fix Confirmed:

C:\myApp>npm install -g phonegap
npm http GET https://registry.npmjs.org/phonegap
npm http 304 https://registry.npmjs.org/phonegap
npm http GET https://registry.npmjs.org/colors
npm http GET https://registry.npmjs.org/node-static
npm http GET https://registry.npmjs.org/cordova/2.9.1
npm http GET https://registry.npmjs.org/optimist
npm http GET https://registry.npmjs.org/phonegap-build/0.8.3
npm http GET https://registry.npmjs.org/prompt
npm http GET https://registry.npmjs.org/qrcode-terminal
npm http GET https://registry.npmjs.org/shelljs/0.1.4
npm http GET https://registry.npmjs.org/semver/1.1.0
npm http 304 https://registry.npmjs.org/colors
npm http 304 https://registry.npmjs.org/cordova/2.9.1
npm http 304 https://registry.npmjs.org/node-static
npm http 304 https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/phonegap-build/0.8.3
npm http 304 https://registry.npmjs.org/prompt
npm http 304 https://registry.npmjs.org/qrcode-terminal
npm http 304 https://registry.npmjs.org/shelljs/0.1.4
npm http 304 https://registry.npmjs.org/semver/1.1.0
npm http GET https://registry.npmjs.org/wordwrap
npm http GET https://registry.npmjs.org/pkginfo
npm http GET https://registry.npmjs.org/read
npm http GET https://registry.npmjs.org/revalidator
npm http GET https://registry.npmjs.org/utile
npm http GET https://registry.npmjs.org/winston
npm http GET https://registry.npmjs.org/mime
npm http GET https://registry.npmjs.org/elementtree/0.1.3
npm http GET https://registry.npmjs.org/plugman/0.8.2
npm http GET https://registry.npmjs.org/express/3.0.0
npm http GET https://registry.npmjs.org/plist
npm http GET https://registry.npmjs.org/xcode/0.5.1
npm http GET https://registry.npmjs.org/shelljs/0.1.2
npm http GET https://registry.npmjs.org/ncallbacks/1.0.0
npm http GET https://registry.npmjs.org/prompt/0.2.7
npm http GET https://registry.npmjs.org/follow-redirects
npm http GET https://registry.npmjs.org/tar
npm http GET https://registry.npmjs.org/open/0.0.3
npm http GET https://registry.npmjs.org/request
npm http GET https://registry.npmjs.org/glob
npm http GET https://registry.npmjs.org/shelljs
npm http GET https://registry.npmjs.org/phonegap-build-api/0.3.3
npm http 304 https://registry.npmjs.org/wordwrap
npm http 304 https://registry.npmjs.org/read
npm http 304 https://registry.npmjs.org/revalidator
npm http 304 https://registry.npmjs.org/utile
npm http 304 https://registry.npmjs.org/winston
npm http 304 https://registry.npmjs.org/pkginfo
npm http 304 https://registry.npmjs.org/mime
npm http 304 https://registry.npmjs.org/elementtree/0.1.3
npm http 304 https://registry.npmjs.org/plugman/0.8.2
npm http 304 https://registry.npmjs.org/express/3.0.0
npm http 304 https://registry.npmjs.org/plist
npm http 304 https://registry.npmjs.org/xcode/0.5.1
npm http 304 https://registry.npmjs.org/shelljs/0.1.2
npm http 304 https://registry.npmjs.org/ncallbacks/1.0.0
npm http 304 https://registry.npmjs.org/prompt/0.2.7
npm http 304 https://registry.npmjs.org/follow-redirects
npm http 304 https://registry.npmjs.org/tar
npm http GET https://registry.npmjs.org/mute-stream
npm http 304 https://registry.npmjs.org/open/0.0.3
npm http 304 https://registry.npmjs.org/request
npm http 304 https://registry.npmjs.org/glob
npm http 304 https://registry.npmjs.org/shelljs
npm http 304 https://registry.npmjs.org/phonegap-build-api/0.3.3
npm http 304 https://registry.npmjs.org/mute-stream
npm http GET https://registry.npmjs.org/deep-equal
npm http GET https://registry.npmjs.org/i
npm http GET https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/ncp
npm http GET https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/async
npm WARN engine ncallbacks@1.0.0: wanted: {"node":"~0.6.7"} (current: {"node":"v
0.10.12","npm":"1.2.32"})
npm http GET https://registry.npmjs.org/underscore
npm http 304 https://registry.npmjs.org/deep-equal
npm http 304 https://registry.npmjs.org/i
npm http 304 https://registry.npmjs.org/ncp
npm http 304 https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/sax/0.3.5
npm http 304 https://registry.npmjs.org/mkdirp
npm http 304 https://registry.npmjs.org/underscore
npm http 304 https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/cycle
npm http GET https://registry.npmjs.org/eyes
npm http GET https://registry.npmjs.org/stack-trace
npm http 304 https://registry.npmjs.org/sax/0.3.5
npm http GET https://registry.npmjs.org/connect/2.6.0
npm http GET https://registry.npmjs.org/commander/0.6.1
npm http GET https://registry.npmjs.org/mkdirp/0.3.3
npm http GET https://registry.npmjs.org/cookie/0.0.4
npm http GET https://registry.npmjs.org/range-parser/0.0.4
npm http GET https://registry.npmjs.org/crc/0.2.0
npm http GET https://registry.npmjs.org/fresh/0.1.0
npm http GET https://registry.npmjs.org/methods/0.0.1
npm http GET https://registry.npmjs.org/send/0.1.0
npm http GET https://registry.npmjs.org/debug
npm http 304 https://registry.npmjs.org/eyes
npm http 304 https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/block-stream
npm http GET https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/fstream
npm http 304 https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/graceful-fs
npm WARN package.json eyes@0.1.8 No repository field.
npm http 304 https://registry.npmjs.org/stack-trace
npm http 304 https://registry.npmjs.org/connect/2.6.0
npm http 304 https://registry.npmjs.org/commander/0.6.1
npm http 304 https://registry.npmjs.org/mkdirp/0.3.3
npm http 304 https://registry.npmjs.org/cookie/0.0.4
npm http 304 https://registry.npmjs.org/range-parser/0.0.4
npm http 304 https://registry.npmjs.org/crc/0.2.0
npm WARN package.json range-parser@0.0.4 No repository field.
npm http 304 https://registry.npmjs.org/fresh/0.1.0
npm http 304 https://registry.npmjs.org/methods/0.0.1
npm http 304 https://registry.npmjs.org/send/0.1.0
npm http 304 https://registry.npmjs.org/debug
npm WARN package.json methods@0.0.1 No repository field.
npm WARN package.json methods@0.0.1 No readme data.
npm WARN package.json fresh@0.1.0 No repository field.
npm http 304 https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/block-stream
npm WARN package.json send@0.1.0 No repository field.
npm http 304 https://registry.npmjs.org/graceful-fs
npm http 304 https://registry.npmjs.org/fstream
npm http 304 https://registry.npmjs.org/cycle
npm http GET https://registry.npmjs.org/mime/1.2.6
npm http GET https://registry.npmjs.org/lru-cache
npm http GET https://registry.npmjs.org/sigmund
npm http GET https://registry.npmjs.org/pegjs/0.6.2
npm http GET https://registry.npmjs.org/node-uuid/1.3.3
npm http 304 https://registry.npmjs.org/mime/1.2.6
npm http 304 https://registry.npmjs.org/sigmund
npm http 304 https://registry.npmjs.org/lru-cache
npm http 304 https://registry.npmjs.org/pegjs/0.6.2
npm http 304 https://registry.npmjs.org/node-uuid/1.3.3
npm http GET https://registry.npmjs.org/qs/0.5.1
npm http GET https://registry.npmjs.org/formidable/1.0.11
npm http GET https://registry.npmjs.org/bytes/0.1.0
npm http GET https://registry.npmjs.org/send/0.0.4
npm http GET https://registry.npmjs.org/pause/0.0.1
npm http 304 https://registry.npmjs.org/qs/0.5.1
npm http 304 https://registry.npmjs.org/bytes/0.1.0
npm http 304 https://registry.npmjs.org/formidable/1.0.11
npm http 304 https://registry.npmjs.org/pause/0.0.1
npm http 304 https://registry.npmjs.org/send/0.0.4
npm WARN package.json bytes@0.1.0 No repository field.
npm WARN package.json formidable@1.0.11 No repository field.
npm WARN package.json pause@0.0.1 No repository field.
npm WARN package.json send@0.0.4 No repository field.
npm http GET https://registry.npmjs.org/bplist-parser
npm http GET https://registry.npmjs.org/xcode/0.6.1
npm http GET https://registry.npmjs.org/nopt
npm http GET https://registry.npmjs.org/osenv
npm http GET https://registry.npmjs.org/ncallbacks/1.1.0
npm http GET https://registry.npmjs.org/underscore/1.4.4
npm http GET https://registry.npmjs.org/dep-graph/1.1.0
npm http GET https://registry.npmjs.org/semver
npm http GET https://registry.npmjs.org/xmlbuilder
npm http GET https://registry.npmjs.org/xmldom
npm http 304 https://registry.npmjs.org/ncallbacks/1.1.0
npm http 304 https://registry.npmjs.org/nopt
npm http 304 https://registry.npmjs.org/bplist-parser
npm http 304 https://registry.npmjs.org/xcode/0.6.1
npm http 304 https://registry.npmjs.org/osenv
npm http 304 https://registry.npmjs.org/underscore/1.4.4
npm http 304 https://registry.npmjs.org/semver
npm http 304 https://registry.npmjs.org/dep-graph/1.1.0
npm http 304 https://registry.npmjs.org/xmlbuilder
npm http 304 https://registry.npmjs.org/xmldom
npm http GET https://registry.npmjs.org/abbrev
npm http GET https://registry.npmjs.org/underscore/1.2.1
npm http 304 https://registry.npmjs.org/abbrev
npm http 304 https://registry.npmjs.org/underscore/1.2.1
C:\Users\Anthony\AppData\Roaming\npm\phonegap -> C:\Users\Anthony\AppData\Roamin
g\npm\node_modules\phonegap\bin\phonegap.js
phonegap@2.9.0-0.12.7 C:\Users\Anthony\AppData\Roaming\npm\node_modules\phonegap

├── colors@0.6.0-1
├── semver@1.1.0
├── qrcode-terminal@0.9.4
├── shelljs@0.1.4
├── optimist@0.3.7 (wordwrap@0.0.2)
├── node-static@0.6.9 (mime@1.2.9)
├── prompt@0.2.11 (revalidator@0.1.5, pkginfo@0.3.0, read@1.0.4, utile@0.2.0, wi
nston@0.6.2)
├── phonegap-build@0.8.3 (qrcode-terminal@0.8.0, shelljs@0.0.9, phonegap-build-a
pi@0.3.3)
└── cordova@2.9.1 (ncallbacks@1.0.0, open@0.0.3, follow-redirects@0.0.3, shelljs
@0.1.2, glob@3.2.1, tar@0.1.17, elementtree@0.1.3, xcode@0.5.1, request@2.12.0,
prompt@0.2.7, express@3.0.0, plist@0.4.3, plugman@0.8.2)

C:\myApp>phonegap run android
  phonegap  detecting Android SDK environment...
  phonegap  using the remote environment
  phonegap  compressing the app...
  phonegap  uploading the app...
  phonegap  building the app...
  phonegap  Android build complete
  phonegap  generating the QRCode...
  < QR CODE IS HERE >
  phonegap  install the app by scanning the QRCode

C:\myApp>phonegap remote build android
  phonegap  compressing the app...
  phonegap  uploading the app...
  phonegap  building the app...
  phonegap  Android build complete

C:\myApp>

@hick
Copy link

hick commented Jul 21, 2013

node_js_err_20130721211751

I got a problem just like the above, in phonegap 3.0.0-0.14.0 on windows, i don't know wether there is some relationship?

it said that(I translate them from chinese )

node_modules\phonegap\node_modules\phonegap-build\res\windows\zip.js
line: 44
char: 1
error: system can not find the file
code: 80070002
source: (null)

@bennmapes
Copy link

O, the D: drive, I'm not sure how well node handles that. I have not tested on a drive other then C: so I'm not exactly sure where the issue lies here. If you have a C: drive try running it from there to see if it works.

@mwbrooks
Copy link
Collaborator Author

Hi @hick

What version of Windows are you running (e.g. Windows XP, 7, or 8)?

Michael

@mwbrooks mwbrooks reopened this Jul 21, 2013
@hick
Copy link

hick commented Jul 23, 2013

@mwbrooks windows XP(5.1.2600).

I know some about javascript, and checked the code of zip.js at line 44 "var zipFolder = shell.NameSpace(zipPath),"

I did a hard code to change the zipPath to "www.zip", then I ran "phonegap run android", it generated the 'build/www.zip'(the size was only 1k, I thought it was not a valid zip file), and then disappeared after another html error came in the command-line as the picture

phonegap-err

the picture above was the first time I ran "phonegap run android", and after that, however I ran it again, it said that

phonegap-err2

and no www.zip was generated.

@hick
Copy link

hick commented Jul 23, 2013

@bennmapes thx, Is it about the phonegap app, or the npm package that should be on the C: drive?
I moved the phonegap app to C: drive, and just like the same...

I will reinstall the npm package to try it again.

@hick
Copy link

hick commented Jul 24, 2013

I did it in a windows xp, installed the npm in C: drive, and create phonegap app in C: drive, reported a err like the picture.

winxp_c

translate chinese into english:

"C:\Document" has no file extension.

while, I tried it in windows 8.1, it worked well!

@mwbrooks
Copy link
Collaborator Author

Thanks for all the details @hick!

Since it works fine on your Windows 8 (and my Windows 7 and 8), I think this is an error related to Windows XP.

I currently don't have Windows XP installed on my system, but I can go ahead and install it to try and recreate your issue.

As some background, the zip.js is actually written in Windows Script Hostings, which looks a lot like JavaScript. Basically, Windows does not have a programmatic way for node.js to create zip files. So, we (@bennmapes) implemented our own using Windows Script Hosting. I imagine the scripting hosting engines are different on Windows XP, 7, and 8, so this is why we are seeing this error.

@sotra
Copy link

sotra commented Jul 27, 2013

zip.js
line 59:
'wscript %s %s %s',
to:
'wscript "%s" %s %s',

@mwbrooks
Copy link
Collaborator Author

Thanks a bunch @sotra

I've updated node-phonegap-build with @sotra's suggestion.

I've published the fix as phonegap@3.0.0-0.14.1.

@hick would you mind updating to the latest version and see if it helps? I'll keep the issue open until I hear back.

@mwbrooks
Copy link
Collaborator Author

mwbrooks commented Aug 3, 2013

Closing this issue. Feel free to re-open if the issue persists on Windows XP.

@mwbrooks mwbrooks closed this as completed Aug 3, 2013
@kolisko
Copy link

kolisko commented Aug 21, 2013

Hi, I have similar problem on Windows XP when building hello world

image

@hick
Copy link

hick commented Aug 23, 2013

so sorry for see it so late, I will check it late and feedback.

thanks a lot for @mwbrooks and @sotra

@jdnichollsc
Copy link

sin ttulo
Alguien me puede ayudar? No entiendo el problema, no se que debo de hacer. Estoy empleando Windows 8, Gracias :)

@pedroflex
Copy link

Hi guys I am experiencing a problem with installation like everybody else excepts my commands go through and everything builds and installs properly. its just once its all finished it kicks out a QRcode that I cant scan does anybody know a way around this??
qrcode

@FraGoTe
Copy link

FraGoTe commented Sep 14, 2013

I had exactly the same problem @pedroflex, I entered to my adobe account and I could see the correct qr.

Greetings!

@pedroflex
Copy link

oh thanks so much I jsut logged into adobe and it works Ive got the code
thanks again peace

On Sat, Sep 14, 2013 at 7:14 PM, Francis Gonzales
notifications@github.comwrote:

I have exactly the same problem @pedroflex https://github.com/pedroflexdid you solve it?


Reply to this email directly or view it on GitHubhttps://github.com//issues/81#issuecomment-24451249
.

@hick
Copy link

hick commented Sep 16, 2013

hehe, It works for me now!

thanks a lot!

@jack-shy
Copy link

The same error with @hick,it still exists in phonegap@3.1.0-0.15.0,OS:windows XP

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

10 participants