Hi, After having chat with Randy, I was able to fix the problem. I ran npm test from lib/nodejs/test and set NODE_HOME to lib/nodejs/lib.
Thank You On Sat, Mar 29, 2014 at 1:13 PM, Chamila Wijayarathna < cdwijayarat...@gmail.com> wrote: > Hi Randy, > I am running thrift source cloned from github [1]. > My running nodejs version is v0.10.25 and thrift version is 1.0.0-dev. > I tried almost everything you suggested, but still getting > > *chamila@chamila-Dell-System-Vostro-3450:~/GSoC/thrift$ nodejs > lib/nodejs/test/client.js -p binary -t buffered * > > *module.js:340* > * throw err;* > * ^* > *Error: Cannot find module 'thrift/transport'* > * at Function.Module._resolveFilename (module.js:338:15)* > * at Function.Module._load (module.js:280:25)* > * at Module.require (module.js:364:17)* > * at require (module.js:380:17)* > * at Object.<anonymous> > (/home/chamila/GSoC/thrift/lib/nodejs/test/client.js:27:24)* > * at Module._compile (module.js:456:26)* > * at Object.Module._extensions..js (module.js:474:10)* > * at Module.load (module.js:356:32)* > * at Function.Module._load (module.js:312:12)* > * at Function.Module.runMain (module.js:497:10)* > > when I tried to run nodejs servers and client. I changed NODE_TEST_DIR to > ${BASEDIR}/../lib/nodejs/test, since there was no bin directory. But here > I am running client manually, not via test.sh. > I tried npm install thrift/transport also, which you mentioned not > required. It gave me > > *chamila@chamila-Dell-System-Vostro-3450:~/GSoC/thrift$ npm install > thrift/transport* > *npm WARN package.json node-int64@0.3.1 No repository field.* > *npm ERR! git clone g...@github.com:thrift/transport Cloning into bare > repository > '/home/chamila/.npm/_git-remotes/git-github-com-thrift-transport-570f268f'...* > *npm ERR! git clone g...@github.com:thrift/transport * > *npm ERR! git clone g...@github.com:thrift/transport ERROR: Repository not > found.* > *npm ERR! git clone g...@github.com:thrift/transport fatal: Could not read > from remote repository.* > *npm ERR! git clone g...@github.com:thrift/transport * > *npm ERR! git clone g...@github.com:thrift/transport Please make sure you > have the correct access rights* > *npm ERR! git clone g...@github.com:thrift/transport and the repository > exists.* > *npm ERR! addLocal Could not install thrift/transport* > *npm ERR! Error: ENOENT, stat 'thrift/transport'* > *npm ERR! If you need help, you may report this *entire* log,* > *npm ERR! including the npm and node versions, at:* > *npm ERR! <http://github.com/isaacs/npm/issues > <http://github.com/isaacs/npm/issues>>* > > *npm ERR! System Linux 3.8.0-19-generic* > *npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" > "thrift/transport"* > *npm ERR! cwd /home/chamila/GSoC/thrift* > *npm ERR! node -v v0.10.25* > *npm ERR! npm -v 1.3.24* > *npm ERR! path thrift/transport* > *npm ERR! code ENOENT* > *npm ERR! errno 34* > *npm ERR! * > *npm ERR! Additional logging details can be found in:* > *npm ERR! /home/chamila/GSoC/thrift/npm-debug.log* > *npm ERR! not ok code 0* > > > > 1. https://github.com/cdwijayarathna/thrift/tree/thrift847 > > Thank You > > > On Fri, Mar 28, 2014 at 5:38 PM, Randy Abernethy <randy.aberne...@rx-m.com > > wrote: > >> Hi Chamila, >> >> Perhaps I can help on the Node.js front. >> >> I assume you are you working with the trunk, and if so: >> >> You do not want to npm install any part of thrift. Running npm install >> thrift will install the latest published branch of thrift for Node.js, >> which is 0.9.1 right now. Because the tests in the trunk are designed to >> test all of the new features in the trunk, the trunk tests will fail >> against the older published thrift code. Also you should never need to npm >> install anything but "thrift". The components of thrift for node.js are all >> installed as a group and not meant to be individually installed (i.e. >> thrift/transport is not supported). >> >> To test against the trunk "make check" in thrift/lib/nodejs runs "npm >> test" which reads the package.json and runs the test script which is >> thrift/lib/nodejs/test/testAll.sh. In order for the tests to find thrift >> the thrift/lib/nodejs/lib directory is added to the NODE_PATH. This avoids >> the need for an "npm install thrift", and allows us to test the trunk >> version of the Node.js thrift library. >> >> You will need to make/install the thrift compiler prior to running the >> Node.js tests because the check needs to compile the ThriftTest.thrift for >> Node.js. >> >> The cross language tests (/thrift/test/test.sh executed by "make cross") >> use the same approach to locate the thrift libs. From thrift/test/test.sh: >> ... >> NODE_TEST_DIR=${BASEDIR}/../bin/nodejs/tests >> export NODE_PATH=${NODE_TEST_DIR}:${NODE_TEST_DIR}/../lib:${NODE_PATH} >> ... >> >> Any npm install activity you see during the test process is to install >> node.js support libs (like q for instance), not thrift itself. >> >> Feel free to shoot me a direct email if this does not get you on the >> right track. >> >> Best, >> Randy >> >> >> >> >> >> >> >> >> On 3/27/2014 11:35 AM, Chamila Wijayarathna wrote: >> >>> Hi Jake, >>> I tried that, but still getting the same result. >>> >>> chamila@chamila-Dell-System-Vostro-3450:~/GSoC/thrift$ sudo npm config >>> set >>> registry http://registry.npmjs.org/ >>> chamila@chamila-Dell-System-Vostro-3450:~/GSoC/thrift$ sudo npm install >>> thrift/transport >>> npm ERR! Could not install: thrift/transport >>> >>> npm ERR! Error: ENOENT, stat 'thrift/transport' >>> npm ERR! You may report this log at: >>> npm ERR! <http://bugs.debian.org/npm> >>> npm ERR! or use >>> npm ERR! reportbug --attach /home/chamila/GSoC/thrift/npm-debug.log >>> npm >>> npm ERR! >>> npm ERR! System Linux 3.8.0-19-generic >>> npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" >>> "thrift/transport" >>> npm ERR! cwd /home/chamila/GSoC/thrift >>> npm ERR! node -v v0.6.19 >>> npm ERR! npm -v 1.1.4 >>> npm ERR! path thrift/transport >>> npm ERR! code ENOENT >>> npm ERR! message ENOENT, stat 'thrift/transport' >>> npm ERR! errno {} >>> npm ERR! >>> npm ERR! Additional logging details can be found in: >>> npm ERR! /home/chamila/GSoC/thrift/npm-debug.log >>> npm not ok >>> >>> Can you send me the patch file, so I can try if it is working? >>> >>> Thank You! >>> >>> >>> On Fri, Mar 28, 2014 at 12:00 AM, Jake Farrell <jfarr...@apache.org> >>> wrote: >>> >>> Run the following before npm install, I ran into this issue as well when >>>> testing the vagrant image, I have a patch for it which I have not >>>> committed >>>> yet >>>> >>>> sudo npm config set registry http://registry.npmjs.org/ >>>> >>>> -Jake >>>> >>>> >>>> On Thu, Mar 27, 2014 at 2:20 PM, Chamila Wijayarathna < >>>> cdwijayarat...@gmail.com> wrote: >>>> >>>> Hello all, >>>>> I trying to run sample nodejs severs and clients in lib/nodejs folder. >>>>> >>>> But >>>> >>>>> when I tried to run them I am getting following error. >>>>> >>>>> *chamila@chamila-Dell-System-Vostro-3450:~/GSoC/thrift$ nodejs >>>>> lib/nodejs/test/client.js -p binary -t buffered * >>>>> >>>>> *module.js:337* >>>>> * throw new Error("Cannot find module '" + request + "'");* >>>>> * ^* >>>>> *Error: Cannot find module 'thrift/transport'* >>>>> * at Function._resolveFilename (module.js:337:11)* >>>>> * at Function._load (module.js:279:25)* >>>>> * at Module.require (module.js:359:17)* >>>>> * at require (module.js:375:17)* >>>>> * at Object.<anonymous> >>>>> (/home/chamila/GSoC/thrift/lib/nodejs/test/client.js:27:24)* >>>>> * at Module._compile (module.js:446:26)* >>>>> * at Object..js (module.js:464:10)* >>>>> * at Module.load (module.js:353:32)* >>>>> * at Function._load (module.js:311:12)* >>>>> * at Array.0 (module.js:484:10)* >>>>> >>>>> I tried to install thrift/transport using npm, but it didn't work >>>>> either. >>>>> >>>>> *chamila@chamila-Dell-System-Vostro-3450:~/GSoC/thrift$ sudo npm >>>>> install >>>>> thrift/transport* >>>>> *[sudo] password for chamila: * >>>>> *npm ERR! Could not install: thrift/transport* >>>>> >>>>> *npm ERR! Error: ENOENT, stat 'thrift/transport'* >>>>> *npm ERR! You may report this log at:* >>>>> *npm ERR! <http://bugs.debian.org/npm <http://bugs.debian.org/npm >>>>> >>* >>>>> *npm ERR! or use* >>>>> *npm ERR! reportbug --attach /home/chamila/GSoC/thrift/npm- >>>>> debug.log >>>>> npm* >>>>> *npm ERR! * >>>>> *npm ERR! System Linux 3.8.0-19-generic* >>>>> *npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" >>>>> "thrift/transport"* >>>>> *npm ERR! cwd /home/chamila/GSoC/thrift* >>>>> *npm ERR! node -v v0.6.19* >>>>> *npm ERR! npm -v 1.1.4* >>>>> *npm ERR! path thrift/transport* >>>>> *npm ERR! code ENOENT* >>>>> *npm ERR! message ENOENT, stat 'thrift/transport'* >>>>> *npm ERR! errno {}* >>>>> *npm ERR! * >>>>> *npm ERR! Additional logging details can be found in:* >>>>> *npm ERR! /home/chamila/GSoC/thrift/npm-debug.log* >>>>> *npm not ok* >>>>> >>>>> What should I do for this? >>>>> >>>>> >>>>> -- >>>>> *Chamila Dilshan Wijayarathna,* >>>>> SMIEEE, SMIESL, >>>>> Undergraduate, >>>>> Department of Computer Science and Engineering, >>>>> University of Moratuwa. >>>>> >>>>> >>> >>> >> > > > -- > *Chamila Dilshan Wijayarathna,* > > SMIEEE, SMIESL, > Undergraduate, > Department of Computer Science and Engineering, > University of Moratuwa. > -- *Chamila Dilshan Wijayarathna,* SMIEEE, SMIESL, Undergraduate, Department of Computer Science and Engineering, University of Moratuwa.