krasota.js icon indicating copy to clipboard operation
krasota.js copied to clipboard

"tree match failed" error

Open wong2 opened this issue 13 years ago • 8 comments

At first, I met the error in #1 , then I tried to install the eyes module by myself with sudo npm install -g eyes, then I run this command krasota -i test.js -b krasota/lib/beautifiers/split-vars and get this error:

/usr/local/lib/node_modules/krasota/lib/krasota.js:47
    throw e
          ^
tree match failed

after you fixed #1, I use sudo npm uninstall -g krasota to unintall the installed package, fetch and merge the code from github, then run sudo npm install -g in the directory of my local clone of krasota, then run krasota -i test.js -b krasota/lib/beautifiers/split-vars again, but I still get the error.

I also tried to install krasota with sudo npm install -g krasota, it doesn't work either.

wong2 avatar Apr 24 '12 14:04 wong2

Can you please provide full content of your test.js file? Also, if you have local clone, can you run npm install && make tests in working copy?

On 24.04.2012, at 17:13, [email protected] wrote:

At first, I met the error in #1 , then I tried to install the eyes module by myself with sudo npm install -g eyes, then I run this command krasota -i test.js -b krasota/lib/beautifiers/split-vars and get this error:

/usr/local/lib/node_modules/krasota/lib/krasota.js:47 throw e ^ tree match failed

after you fixed #1, I use sudo npm uninstall -g krasota to unintall the installed package, fetch and merge the code from github, then run sudo npm install -g in the directory of my local clone of krasota, then run krasota -i test.js -b krasota/lib/beautifiers/split-vars again, but I still get the error.

I also tried to install krasota with sudo npm install -g krasota, it doesn't work either.


Reply to this email directly or view it on GitHub: https://github.com/veged/krasota.js/issues/3

veged avatar Apr 24 '12 15:04 veged

I cloned the repo with git clone https://github.com/veged/krasota.js.git, then I cd into krasota.js, run npm install, then I run make tests, this is the result:

module.js:332 throw new Error("Cannot find module '" + request + "'"); ^ Error: Cannot find module 'krasota/lib/beautifiers/always-semicolons' at Function._resolveFilename (module.js:332:11) at Function._load (module.js:279:25) at Module.require (module.js:354:17) at require (module.js:370:17) at /home/wong2/codes/js/krasota/tests/tests.js:21:28 at Array.map (native) at /home/wong2/codes/js/krasota/tests/tests.js:20:18 at [object Object]. (fs.js:115:5) at [object Object].emit (events.js:64:17) at afterRead (fs.js:1117:12) make: *** [tests/always-semicolons] Error 1

wong2 avatar Apr 25 '12 04:04 wong2

you need also run npm link in working copy, because of using global paths for beautifiers in tests :-( i will fix it later

On 25.04.2012, at 7:24, [email protected] wrote:

I cloned the repo with git clone https://github.com/veged/krasota.js.git, then I cd into krasota.js, run npm install, then I run make tests, this is the result:

module.js:332 throw new Error("Cannot find module '" + request + "'"); ^ Error: Cannot find module 'krasota/lib/beautifiers/always-semicolons' at Function._resolveFilename (module.js:332:11) at Function._load (module.js:279:25) at Module.require (module.js:354:17) at require (module.js:370:17) at /home/wong2/codes/js/krasota/tests/tests.js:21:28 at Array.map (native) at /home/wong2/codes/js/krasota/tests/tests.js:20:18 at [object Object]. (fs.js:115:5) at [object Object].emit (events.js:64:17) at afterRead (fs.js:1117:12) make: *** [tests/always-semicolons] Error 1


Reply to this email directly or view it on GitHub: https://github.com/veged/krasota.js/issues/3#issuecomment-5324120

veged avatar Apr 25 '12 06:04 veged

I tried to run sudo npm link, then I run make tests , I still got the error.

wong2 avatar Apr 25 '12 07:04 wong2

after npm link you still have the same error?

module.js:332
throw new Error("Cannot find module '" + request + "'");
^
Error: Cannot find module 'krasota/lib/beautifiers/always-semicolons'

veged avatar Apr 25 '12 16:04 veged

yes

wong2 avatar Apr 26 '12 04:04 wong2

I think you have't npm's root path in your NODE_PATH, so node can't find global installed npm modules. Try this: echo 'export NODE_PATH="'$(npm root -g):$NODE_PATH'"'>> ~/.bashrc && . ~/.bashrc (or change for your environment).

veged avatar Apr 26 '12 08:04 veged

anyway i think to remove all global paths from tests

veged avatar Apr 26 '12 08:04 veged