Closed Diferno closed 2 years ago
Hi,
thanks for reporting the issue. This is somewhat strange, i don't know what exactly causes the problem, but for the moment I have a work around for you. If you use the examples/browser-example/simple-example.js
outside the original handlebars-i18n folder you need to require i18next
in line 16 like this:
const i18next = require('./node_modules/handlebars-i18n/node_modules/i18next/index');
instead of:
const i18next = require('i18next');
Should work for the moment. I try to fix the dependency tree as soon as I have the time to fully investigate the problem. Cheers!
Okay, here it comes. Since npm version >= 7 peer Depenedencies are installed differently.
If you use npm >= 7 do:
$ npm i handlebars-i18n
For older versions do:
$ npm i handlebars-i18n handlebars@4.7.6 i18next@20.2.1 intl@1.2.5
This resolves the issue. I fixed in in the readme.md. Thanks for noticing the problem !
Hi i have the same issue. Im using npm 7.10.0 and installed it via npm i handlebars-i18n
When im running your example following error appears:
Error: Cannot find module '../../dist/handlebars-i18n.js'
My package.json looks like:
{ "name": "handlebars-i18n", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "node index.js" }, "author": "", "license": "ISC", "dependencies": { "handlebars-i18n": "^1.4.0" } }
Have you tried installing via $ npm i handlebars-i18n handlebars@4.7.6 i18next@20.2.1 intl@1.2.5
?
Yes. Also with npm 7.10.0. Then this appears:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: handlebars-i18n@1.0.0
npm ERR! Found: handlebars@4.7.6
npm ERR! node_modules/handlebars
npm ERR! handlebars@"4.7.6" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer handlebars@"^4.7.7" from handlebars-i18n@1.4.0
npm ERR! node_modules/handlebars-i18n
npm ERR! handlebars-i18n@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /Users/sergejrube/.npm/eresolve-report.txt for a full report.
Okay, I will try to reproduce your error. Gimme some time, please.
Hi!
Have been using your module for currency and numbers for a while. Now I need to i18n text and... found that always returns undefined. Grabbed the example in your code, and also got undefineds where the text should appear. Is it a version related?
This is the output I get when running the example code using the modules installed from
npm
using this versions: package.jsonThis is the output running the same example but requiring the handlebars-i18n.js that is in your dist folder of the example.