mirror of
https://github.com/grpc/grpc-node.git
synced 2025-12-08 18:23:54 +00:00
grpc-js: resolve node/no-unpublished-require
This commit is contained in:
parent
2c3c22ea2a
commit
70a92d2fc3
@ -62,7 +62,8 @@ import {
|
||||
ServerDuplexStream,
|
||||
} from './server-call';
|
||||
|
||||
const supportedNodeVersions = require('../../package.json').engines.node;
|
||||
import { engines as supportedEngines } from '../package.json';
|
||||
const supportedNodeVersions = supportedEngines.node;
|
||||
if (!semver.satisfies(process.version, 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 * as net from 'net';
|
||||
|
||||
const { version: clientVersion } = require('../../package.json');
|
||||
import { version as clientVersion } from '../package.json';
|
||||
|
||||
const TRACER_NAME = 'subchannel';
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
"outDir": "build",
|
||||
"target": "es2017",
|
||||
"module": "commonjs",
|
||||
"resolveJsonModule": true,
|
||||
"incremental": true
|
||||
},
|
||||
"include": [
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user