diff --git a/packages/grpc-js/.eslintrc b/packages/grpc-js/.eslintrc index b18ad0ed..64585682 100644 --- a/packages/grpc-js/.eslintrc +++ b/packages/grpc-js/.eslintrc @@ -5,6 +5,7 @@ "node/no-unpublished-import": ["error", { "tryExtensions": [".ts", ".js", ".json", ".node"] }], - "@typescript-eslint/no-unused-vars": "off" + "@typescript-eslint/no-unused-vars": "off", + "node/no-unpublished-require": "off" } } diff --git a/packages/grpc-js/src/index.ts b/packages/grpc-js/src/index.ts index e4bb3658..661e0efd 100644 --- a/packages/grpc-js/src/index.ts +++ b/packages/grpc-js/src/index.ts @@ -62,8 +62,7 @@ import { ServerDuplexStream, } from './server-call'; -import { engines as supportedEngines } from '../package.json'; -const supportedNodeVersions = supportedEngines.node; +const supportedNodeVersions = require('../../package.json').engines.node; if (!semver.satisfies(process.version, supportedNodeVersions)) { throw new Error(`@grpc/grpc-js only works on Node ${supportedNodeVersions}`); } diff --git a/packages/grpc-js/src/subchannel.ts b/packages/grpc-js/src/subchannel.ts index 3f71720e..de69c486 100644 --- a/packages/grpc-js/src/subchannel.ts +++ b/packages/grpc-js/src/subchannel.ts @@ -29,7 +29,7 @@ import { LogVerbosity } from './constants'; import { shouldUseProxy, getProxiedConnection } from './http_proxy'; import * as net from 'net'; -import { version as clientVersion } from '../package.json'; +const clientVersion = require('../../package.json').version; const TRACER_NAME = 'subchannel';