assets-packager
assets-packager copied to clipboard
Cannot assetspkg on examples
I got this error while trying out on the /examples folder. Same problem on Win7 / Linux.
/usr/local/lib/node_modules/assets-packager/node_modules/assets-expander/lib/assets.js:12
throw new AssetsExpander.YamlSyntaxError(e.toString());
^
YamlSyntaxError: TypeError: Cannot read property '1' of undefined
at Object.AssetsExpander (/usr/local/lib/node_modules/assets-packager/node_modules/assets-expander/lib/assets.js:12:11)
at Object.
Thanks @tot2ivn for reporting this issue. We refactored the whole project recently to get rid of platform compatibility issues like YAML parsing so it's interesting to see such a problem pops up. Can you confirm you have the most recent version checked out (I assume you do) and that you didn't make any changes to examples/assets.yml? Also which version of node do you run?
Jakub Pawlowicz
Hi Jakub,
Here is how to reproduce the problem:
- I git clone assets-packager. Git version of project downloaded is: f2399a4
- I make no modifications to any files and jump directly to /examples folder and try out the code : assetspkg -c assets.yml -g
Baam, error shows like above.
*The node I'm running on Win7/Linux is both v0.8.2
Thanks for looking into this :)
It seems it's not a problem with node itself as here it runs fine on 0.8.2.
Is it possible that you have an older version of assetspkg on your system already installed via npm? If so then 'assetspkg -c assets.yml -g' will use the global one instead of local one. You can verify it via assetspkg -v
(the newest one is 0.7.0).
If you do then try running ../bin/assetspkg -c assets.yml -g
instead in /examples.
@tot2ivn did you manage to find out what was wrong with running the example?
My global installed assetspkg is actually v0.7.0 ..but it still didn't work. If I try running ../bin/assetspkg -c assets.yml -g , then there is a more obvious error:
Error: Cannot find module 'uglify-js'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at Object.
I didn't have time to look into this, so still now sure what's wrong.
Could you then try one more thing then - please run npm install
in project's root directory and then ../bin/assetspkg -c assets.yml -g
under examples. Wild guess tells me it should work that way.
Ah npm install
installs all the packages; however, it still does not work, and shows the same error as when using the globally installed assets-packager..
I'm totally puzzled over this bug, especially since it occurs on both Linux and Win 7. I'll try to find the reason and will get back to you.
On 17 sie 2012, at 00:53, Totti Anh Nguyen [email protected] wrote:
Ah javascript npm install installs all the packages; however, it still does not work, and shows the same error as when using the globally installed assets-packager..
— Reply to this email directly or view it on GitHub.
Hi @tot2ivn,
Sorry for not getting back to you earlier on. Would it be possible for you to check if it's still reproducible if you:
- Fetch assets-packager by downloading zipped source (ZIP icon) and unpack it.
- Run
npm install
in downloaded folder. - Run
../bin/assetspkg -c assets.yml
in the download's examples directory.
It seems to us git could be blamed for this error but we are still not sure.
Thank you for your time! Jakub
Hello @GoalSmashers !
Not sure, that it's still actual. I tried your last solution (on win 8). It still not working.
On step 3 I got: '..\bin\assetspkg' is not recognized as an internal or external command,operable program or batch file.
Replaced with node ..\bin..., then got error:
F:\akepath\assets-packager-master\node_modules\assets-expander\lib\assets.j
s:12
throw new AssetsExpander.YamlSyntaxError(e.toString());
^
YamlSyntaxError: SyntaxError: near "
application: 'reset,gr"
at Object.AssetsExpander (F:\akepath\assets-packager-master\node_module
s\assets-expander\lib\assets.js:12:11)
at new Packager (F:\akepath\assets-packager-master\lib\packager.js:17:1
8)
at Object.
Hi @m-teslya. Let me check it for you today when I can get my hands on a Win machine.
So far no luck reproducing this issue. It's been bothering people before as well.
Do you check it out with git or GitHub for Windows? And what shell do you use?
Do you check it out with git or GitHub for Windows? No, as recommended, I got code using "Download zip" button And what shell do you use? cmd.exe, standard Windows command processor When installing globally, I used command npm install -g assets-packager
@m-teslya it appears to be a problem with "Download zip" functionality as it gives incorrect line endings in YAML files.
Can you give it a try via GitHub for Windows?