Skip to content

Commit

Permalink
Merge pull request #1358 from murgatroid99/grpc-js_js_pack_fix
Browse files Browse the repository at this point in the history
grpc-js: Fix how package.json is loaded
  • Loading branch information
murgatroid99 authored Apr 14, 2020
2 parents 227a35e + b489935 commit 5566f1d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion packages/grpc-js/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
3 changes: 1 addition & 2 deletions packages/grpc-js/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/grpc-js/src/subchannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down

0 comments on commit 5566f1d

Please sign in to comment.