[
https://issues.apache.org/jira/browse/THRIFT-5029?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17103895#comment-17103895
]
4F2E4A2E commented on THRIFT-5029:
----------------------------------
I would like to confirm this issue.
thrift.js is on the src folder:
{code:java}
var thrift = require('thrift/src/thrift');{code}
With that, the module can be found, but it leads not another problem:
{code:java}
/Users/oss/.nvm/versions/node/v12.16.1/bin/node
/Users/oss/src/acme/rnd/thrift-nodejs/gen-nodejs/Calculator.js
/Users/oss/src/acme/rnd/thrift-nodejs/gen-nodejs/tutorial_types.js:132
Thrift.inherits(InvalidOperation, Thrift.TException);
^
TypeError: Cannot read property 'inherits' of undefined
at Object.<anonymous>
(/Users/oss/src/acme/rnd/thrift-nodejs/gen-nodejs/tutorial_types.js:132:8)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Module.require (internal/modules/cjs/loader.js:1044:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object.<anonymous>
(/Users/oss/src/acme/rnd/thrift-nodejs/gen-nodejs/Calculator.js:19:14)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
Process finished with exit code 1
{code}
> Latest (0.13.0) Node.js lib does not provide entry point
> --------------------------------------------------------
>
> Key: THRIFT-5029
> URL: https://issues.apache.org/jira/browse/THRIFT-5029
> Project: Thrift
> Issue Type: Bug
> Components: Node.js - Library
> Reporter: Anton Golub
> Priority: Major
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> The latest published `thrift` version:
> * does not contain 'index.js' at the package root
> * has no "main" entry point in package.json
> So module request throws an exception:
> {code:java}
> require('thrift')
> Thrown:
> Error: Cannot find module 'thrift'
> Require stack:
> - <repl>
> at Function.Module._resolveFilename
> (internal/modules/cjs/loader.js:625:15)
> at Function.Module._load (internal/modules/cjs/loader.js:527:27)
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)