Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Windows 10: "no such file or directory" and "was unexpected at this time" errors #7

Open
datee opened this issue Nov 30, 2015 · 12 comments
Labels
Milestone

Comments

@datee
Copy link

datee commented Nov 30, 2015

SWC will not build:
Following the exact same steps as the dts2as example here, and using the exact same ts-d file : http://nextgenactionscript.com/tutorials/dts2as-typescript-definitions-with-actionscript/

This results in the following error:

G:\rs\typescript\pixi>dts2as --outSWC pixijs.swc pixi.js.d.ts

fs.js:584

return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);

               ^

Error: ENOENT: no such file or directory, open 'G:\rs\typescript\pixi\dts2as_generated\pixijs.js'
at Error (native)
at Object.fs.openSync (fs.js:584:18)
at Object.fs.writeFileSync (fs.js:1224:33)
at Object. (C:\Users\Tommy\AppData\Roaming\npm\node_modules\dts2as\bin\cli.js:258:4)
at Module._compile (module.js:425:26)
at Object.Module._extensions..js (module.js:432:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)

Same error happens for most tested ts typedefinition files.
Using Node-js 5.1.0 on Windows 10 with dts2as@0.6.1

There is no "dts2as_generated" folder, and using the option -outDir does not create one either.

Using Node 4.2.2 the error is different:

The SWC could not be created. The generated ActionScript contains compile-time errors."
..and with 4.2.2 using the -outDir option sometimes .as files are created.

Have tested on several win10 computers, and the error is the same...

@joshtynjala
Copy link
Member

Thank you for reporting. The dts2as_generated folder should have been created in a previous step. It's strange that it didn't throw an error earlier, though. That may indicate that it's creating the dts2as_generated folder somewhere unexpected.

I tested this version on Windows 8.1, but not on Windows 10. I'll try with Windows 10 to see if I can reproduce too. Maybe something has changed in that version.

@joshtynjala joshtynjala added the bug label Dec 1, 2015
@joshtynjala joshtynjala added this to the 0.7 milestone Dec 1, 2015
@datee
Copy link
Author

datee commented Dec 2, 2015

The issue seem to be related to windows10 alright.. I've tried 3 different windows 10 computers and the bug is the same on all of them...

@joshtynjala
Copy link
Member

I can successfully reproduce this issue on Windows 10. I'll get it fixed soon!

joshtynjala added a commit that referenced this issue Dec 3, 2015
…cepts patch updates because SyntaxKind enums can change between minor updates (references #7)
@datee
Copy link
Author

datee commented Dec 3, 2015

So trying with 0.6.2 , the error is different... and the same as it was with Node.4.2.2
dts2as --outSWC pixijs.swc pixi.js.d.ts

\FlashDevelop\Tools\apacheflexjs\bin..) was unexpected at this time.
Could not create SWC file. The generated ActionScript contains compile-time errors.

@joshtynjala
Copy link
Member

I just tested, and everything seems to working correctly for me on Windows 10.

I see that you left out the --flexHome argument. Are you certain that your FLEX_HOME environment variable is set correctly?

@joshtynjala
Copy link
Member

I tested using both Node 4.2.2 and 5.1.0. I tried putting a space in the path to FlexJS, since that error seemed like it might indicate that there was a space in your path. I tried using --flexHome and falling back to a valid FLEX_HOME environment variable. I still cannot reproduce on Windows 10 with dts2as 0.6.2.

You could try uninstalling with npm uninstall -g dts2as. Then, reinstall and try again.

@datee
Copy link
Author

datee commented Dec 3, 2015

Hm. I tried that. No change. Yes FLEX_HOME is set up correctly. Using FLEX_HOME ev.var or --flexHome does not change anything either. --outDir creates a folder with all the .as files.. they look correct. But still no swc file. Although the first time i ran the script a dts2as_generated folder appeared, but was removed immediately....

Tried this on several different windows 10 computers too. All give the same error.

@joshtynjala
Copy link
Member

What is the full path that you are using for FLEX_HOME or --flexHome?

@datee
Copy link
Author

datee commented Dec 3, 2015

So i found the error :

FlexJS was located in this folder :C:\Program Files (x86)\FlashDevelop\Tools\apacheflexjs
Moving FlexJS to c:\flexjs\ fixes the problem.

Even though the flexjs path has " " when using --flexHome or is correct with the FLEX_HOME var,
i guess the space in the path is still making the script fail...

@joshtynjala
Copy link
Member

I don't understand how it could be happening. I also tested with a space in the path today, as I mentioned. In fact, the reason I needed to create version 0.6.1 was to fix an issue on Windows when there were spaces in the path to FlexJS or in the path of the current working directory. This should be addressed already. I'm stumped.

@joshtynjala joshtynjala changed the title Unable to build swc files Windows 10: "no such file or directory" and "was unexpected at this time" errors Dec 3, 2015
@datee
Copy link
Author

datee commented Dec 3, 2015

Ok, an update : The error is infact NOT the space itself, but the character " ) " ... This single character in the path creates the error. (just the right parentheses, not the left..)

@joshtynjala
Copy link
Member

Now, that's interesting. I wondered why your error included a path with ..) at the end

\FlashDevelop\Tools\apacheflexjs\bin..)

Perhaps it is unexpected behavior from Node's path.join(). I'll try to figure out what's happening there.

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

No branches or pull requests

2 participants