Spine.js & hem getting started

2019-02-20 04:39发布

I successfully created a spine app as explained on spine's Getting started page. However, hem doesn't automatically take my changes into account ; I have to build manually.

I have the same problem when I follow the contact screencast, but this time hem does not build at all :

 art-mac:spine.contacts art$ hem build

 node.js:201
         throw e; // process.nextTick error, or 'error' event on first tick
               ^
 Cannot find module: spine/lib/tmpl. Have you run `npm install .` ?

I did run 'npm install .'

Surprisingly, when I reinstall spine.contact (in another folder), the contacts I created in the previous contact app appear in the new app... "Disable cash" in my chrome development settings in checked.

标签: spine.js
3条回答
虎瘦雄心在
2楼-- · 2019-02-20 05:14

I was having the same problem when I first upgraded hem to version 0.1.9. One thing to check for is if there are compiled application.js and application.css files in the public folder of your application. It seems like when these files already exist hem server would serve those files instead of recompiling from the sources. Once those files are removed hem server would then use the source files to dynamically create the application files.

But this behavior did seem a bit different from older versions of hem. I was able to make a couple of changes to the hem server so that it seem to work as before, in that the hem server would always compile from the source files regardless if the application files already existed. I posted the code changes on a similar issue at the hem github repository https://github.com/maccman/hem/issues/46#issuecomment-6550866, but I'm not sure if its a hem issue or if something changed with the strata web server library that hem uses.

查看更多
Juvenile、少年°
3楼-- · 2019-02-20 05:23

Hem 0.1.9 (the latest version) is not automatically detecting changes to my spine app when running "hem server"(although "hem watch" seems to be working correctly). I was able to get it working by uninstalling 0.1.9 (npm uninstall -g hem) and installing 0.1.8 instead (npm install -g hem@0.1.8).

Regarding your other issue, spine/lib/tmpl is no longer included in the latest version of spine, so if you want to use the screencast you'll need to install whatever version of spine he is using.

查看更多
贪生不怕死
4楼-- · 2019-02-20 05:26

The latest Hem in npm (0.2.7) should solve this issue.

The strata server was having issues serving files dynamically if they already existed.

查看更多
登录 后发表回答