Updating handlebars dependency to 2.0.0
Nooshu opened this issue · comments
Hello,
Hopefully someone can help. I really need to use {{@root}} in a couple of each loops, which has been added to version 2.0.0 according to this post, but looking at the dependencies version 1.3.0 is currently being installed and used.
Is there any way to force assemble to use version 2.0.0?
I tried this method but had no luck. Any help would be greatly appreciated.
Thanks.
@Nooshu I was able to get the npm shrinkwrap --dev
command to work, but there are a few things you need to do first:
- delete
handlebars
fromnode_modules/assemble/node_modules/assemble-handlebars/node_modules/
- update
handlebars
version to~2.0.0
inpackage.json
inhandlebars-helpers
:node_modules/assemble/node_modules/assemble-handlebars/node_modules/handlebars-helpers/package.json
- update
handlebars
version to~2..0.0
inpackage.json
inassemble-handlebars
:node_modules/assemble/node_modules/assemble-handlebars/package.json
- from the
node_modules/assemble/node_modules/assemble-handlebars/
folder, runnpm install handlebars@latest
- from your project's root directory run
npm shrinkwrap --dev
The last command should make the shrinkwrap file that you need. Now you can remove your node_modules folder and do npm cache clear && npm i
and the dependencies will install correctly.
I tried making a simple npm-shrinkwrap.json
file with just the assemble dependencies need, but it only installed those and nothing else form package.json
.
Before trying this out, I was going to bump the version in assemble-handlebars
, but if I do that, then we'd have to bump the minor version on assemble too and we're not ready to do that yet.
Hi @doowb
thanks for the workaround. Unfortunately it doesn't seem to survive an rm -rf node_modules
, so one has to check in node_modules into source control (or at least node_modules/assemble/node_modules/assemble-handlebars/
).
Sounds like that would be an issue with the npm shrinkwrap --dev
command or npm install
not respecting the shrinkwrap package.
In any case, Handlebars has been updated in grunt-assemble
so if you're still using assemble@0.4.x
you should start using grunt-assemble
(or try out the latest assemble directly).
Thx @doowb it seems that using grunt-assemble solves the problem, and I even managed to produce the right magical incantations in Gruntfile.js and package.json :)