Ich versuche, das Nodejs Server/Client-Sparsamkeit Beispiel auszuführen, aber ich kann es nicht zum Laufen bekommen. Anfangs fügte ich Sparsamkeit als Abhängigkeit in meine package.json
Datei hinzu. Dann habe ich eine npm install
, die Sparsamkeit installiert. Dann habe ich versucht, den Server mit node NodeServer.js
auszuführen. Ich erhalte einen ähnlichen Fehler, wenn ich versuche, NodeClient.js
auszuführen.Verweis auf Thrift nicht gefunden beim Ausführen von nodejs Thrift Beispiel
Link zur Thrift NodeJS Tutorial - http://thrift.apache.org/tutorial/nodejs
Ich habe die Ausgabe der entsprechenden Befehle unten angebracht.
[email protected]:~/git/nodejs-thrift$ ls
gen-js NodeClient.js NodeServer.js package.json shared.thrift tutorial.thrift
[email protected]:~/git/nodejs-thrift$ npm install
> [email protected]32 install /home/h/git/nodejs-thrift/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory '/home/h/git/nodejs-thrift/node_modules/ws/build'
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
bufferutil.target.mk:92: recipe for target 'Release/obj.target/bufferutil/src/bufferutil.o' failed
make: Leaving directory '/home/h/git/nodejs-thrift/node_modules/ws/build'
[email protected] /home/h/git/nodejs-thrift
└─┬ [email protected]
├── [email protected]
├── [email protected]
└─┬ [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm WARN [email protected] No license field.
[email protected]:~/git/nodejs-thrift$ node NodeServer.js
/home/h/git/nodejs-thrift/gen-js/Calculator.js:384
Thrift.inherits(CalculatorClient, SharedServiceClient)
^
ReferenceError: Thrift is not defined
at Object.<anonymous> (/home/h/git/nodejs-thrift/gen-js/Calculator.js:384:1)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/home/h/git/nodejs-thrift/NodeServer.js:21:18)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
[email protected]:~/git/nodejs-thrift$