mirror of https://github.com/grpc/grpc-node.git
grpc-js: Fix how package.json is loaded
This commit is contained in:
parent
227a35e899
commit
b489935b7c
|
|
@ -5,6 +5,7 @@
|
||||||
"node/no-unpublished-import": ["error", {
|
"node/no-unpublished-import": ["error", {
|
||||||
"tryExtensions": [".ts", ".js", ".json", ".node"]
|
"tryExtensions": [".ts", ".js", ".json", ".node"]
|
||||||
}],
|
}],
|
||||||
"@typescript-eslint/no-unused-vars": "off"
|
"@typescript-eslint/no-unused-vars": "off",
|
||||||
|
"node/no-unpublished-require": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -62,8 +62,7 @@ import {
|
||||||
ServerDuplexStream,
|
ServerDuplexStream,
|
||||||
} from './server-call';
|
} from './server-call';
|
||||||
|
|
||||||
import { engines as supportedEngines } from '../package.json';
|
const supportedNodeVersions = require('../../package.json').engines.node;
|
||||||
const supportedNodeVersions = supportedEngines.node;
|
|
||||||
if (!semver.satisfies(process.version, supportedNodeVersions)) {
|
if (!semver.satisfies(process.version, supportedNodeVersions)) {
|
||||||
throw new Error(`@grpc/grpc-js only works on Node ${supportedNodeVersions}`);
|
throw new Error(`@grpc/grpc-js only works on Node ${supportedNodeVersions}`);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ import { LogVerbosity } from './constants';
|
||||||
import { shouldUseProxy, getProxiedConnection } from './http_proxy';
|
import { shouldUseProxy, getProxiedConnection } from './http_proxy';
|
||||||
import * as net from 'net';
|
import * as net from 'net';
|
||||||
|
|
||||||
import { version as clientVersion } from '../package.json';
|
const clientVersion = require('../../package.json').version;
|
||||||
|
|
||||||
const TRACER_NAME = 'subchannel';
|
const TRACER_NAME = 'subchannel';
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue