Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lasso-page tag not compiled when lasso and/or marko installed global #5

Open
ngocphuongnb opened this issue Feb 3, 2017 · 0 comments

Comments

@ngocphuongnb
Copy link

ngocphuongnb commented Feb 3, 2017

I have a package which use marko and lasso as template engine. For example, package named PA.
PA was installed global:
pa.js (located at /usr/lib/node_modules/pa)

exports.render = function(data, viewFile, callback) {
    var viewObj = require(viewFile);
    viewObj.render(data, function(err, html) {
            callback(err, html);
    });
}

pb.js

var paLib = require('pa');
//some logic
paLib.render('/view/file/in/pb/directory/view.marko', {}, function(err, html) {
    console.log(html) //lasso-page not compiled
});

/view/file/in/pb/directory/view.marko

<lasso-page package-path="./browser.json"/>

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Test Page</title>
    <lasso-head/>
</head>
<body>
    <h1>Test Page</h1>
    <lasso-body/>
</body>
</html>

when run node pb.js, i got this error

error:  Error: Cannot find module 'marko/compiler'
at Function.Module._resolveFilename (module.js:469:15)
at module.exports (/usr/lib/node_modules/pa/node_modules/marko/node_modules/resolve-from/index.js:15:16)
at Object.markoExtension [as .marko] (/usr/lib/node_modules/pa/node_modules/marko/node-require.js:111:39)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at /usr/lib/node_modules/pa/pa.js:225:13
at process._tickCallback (internal/process/next_tick.js:103:7)

I tried install lasso and marko locally in PB package, the error gone away but lasso-page, lasso-head and lasso-body tags are not compiled, the rendered html was the same as view.marko file

Tested on windows 10: nodejs v6.9.1, npm v3.10.8
and centos 6.6: nodejs v6.9.5, npm v3.10.10
both marko and lasso were the latest version.

Please help me resolve this problem, thank you!

@ngocphuongnb ngocphuongnb changed the title lasso-page tag not compiled when lass and/or marko installed global lasso-page tag not compiled when lasso and/or marko installed global Feb 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant