-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
When the command "browserify main.js -o bundle.js" is run for main.js (see below)
const google = require('googleapis')
async function runSample() {
const drive = google.drive({
version: 'v2',
headers: {
Authorization: `Bearer authToken`,
},
})
// Make an authorized request to list Drive files.
const res = await drive.files.list()
return res
}
runSample().catch(console.error)it throws the error:
Error: Can't walk dependency graph: ENOENT: no such file or directory, lstat 'C:\project\process'
required by C:\project\node_modules\googleapis-common\build\src\http2.js
Browserify seems to be looking in the wrong directory for the module, what gives?
These are the imports of the 'node_modules\googleapis-common\build\src\http2.js' file, which uses the node:process module:
Object.defineProperty(exports, "__esModule", { value: true });
exports.closeSession = exports.request = exports.sessions = void 0;
const http2 = require("http2");
const zlib = require("zlib");
const url_1 = require("url");
const qs = require("qs");
const extend = require("extend");
const stream_1 = require("stream");
const util = require("util");
const process = require("process");
const common_1 = require("gaxios/build/src/common");
const { HTTP2_HEADER_CONTENT_ENCODING, HTTP2_HEADER_CONTENT_TYPE, HTTP2_HEADER_METHOD, HTTP2_HEADER_PATH, HTTP2_HEADER_STATUS, } = http2.constants;
const DEBUG = !!process.env.HTTP2_DEBUG;Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels