matt-ball / postman-local

A client to facilitate local development of scripts for Postman.
Apache License 2.0
70 stars 6 forks source link

Built-in libraries from the Postman Sandbox aren't included when running postman sync. #36

Closed kevinswiber closed 4 years ago

kevinswiber commented 4 years ago

When running postman sync from a bootstrapped collection, Browserify can't build the dependency graph if the Postman built-in modules haven't been npm install'd. Can these either be detected ahead of time and installed or can we optimistically install all built-in libraries from the Postman sandbox on the initial bootstrap?

➜ postman sync
(node:32473) UnhandledPromiseRejectionWarning: Error: Can't walk dependency graph: Cannot find module 'lodash' from '/private/tmp/postman-cli-test/postman/Utilities/Delay Response/test.js'
    required by /private/tmp/postman-cli-test/postman/Utilities/Delay Response/test.js
    at /usr/local/lib/node_modules/@matt.ball/postman-cli/node_modules/resolve/lib/async.js:115:35
    at processDirs (/usr/local/lib/node_modules/@matt.ball/postman-cli/node_modules/resolve/lib/async.js:268:39)
    at isdir (/usr/local/lib/node_modules/@matt.ball/postman-cli/node_modules/resolve/lib/async.js:275:32)
    at /usr/local/lib/node_modules/@matt.ball/postman-cli/node_modules/resolve/lib/async.js:25:69
    at FSReqCallback.oncomplete (fs.js:175:21)

Note: The workaround for this was just doing npm i lodash and moving forward.