Search code examples
node.jsangularthrift

Can't resolve 'thrift'


I installed thrift in my win 10 machine and y try to run an angular service that uses thrift generated files.

I added to the package JSON "@types/thrift": "^0.10.9", "thrift": "^0.13.0", but when I run keep getting the next error where Session is a thrift generated file

Module not found: Error: Can't resolve 'thrift' in '/mnt/c/Users/....../src/app/shared/thrift- 
connector'
ERROR in ./src/thrifts/Session.js

Than starts with : "use strict";

var thrift = require('thrift');
var Thrift = thrift.Thrift;

I generate the files with a npm scripy:

"thirft": "thrift -r --out src/thrifts -I thrifts --gen js:node thrifts/all.thrift"

I also tested this in a ubuntu WSL but with the same results.


Solution

  • I resolve this instaling the repositroy version of thrift

      "thrift": "git+https://github.com/apache/thrift.git",