web-speech-cognitive-services icon indicating copy to clipboard operation
web-speech-cognitive-services copied to clipboard

Install failure at [email protected] postinstall:commonjs script.

Open JamesBrill opened this issue 3 years ago • 4 comments

I'm unable to install the latest version of this polyfill (note that I have installed the Azure peer dependency). The failure comes from a post-install script in the latest major version of a dependency owned by the author of this polyfill: p-defer-es5. The issue seems related to a mismatch between CommonJS and ES6 modules:

> [email protected] postinstall /home/consumer-package/node_modules/p-defer-es5
> npm run postinstall:commonjs && npm run postinstall:esm


> [email protected] postinstall:commonjs /home/consumer-package/node_modules/p-defer-es5
> node ./scripts/esbuild.mjs p-defer ./src/index.js cjs ./lib/index.bundled.js && babel ./lib/index.bundled.js --config-file ./babel.config.commonjs.json --out-file ./lib/index.js

/home/consumer-package/node_modules/p-defer-es5/scripts/esbuild.mjs:1
import { createRequire } from 'module';
       ^

SyntaxError: Unexpected token {
    at Module._compile (internal/modules/cjs/loader.js:721:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

I am still able to install web-speech-cognitive-services 7.1.0, which appears to use the previous major version of p-defer-es5.

JamesBrill avatar Nov 06 '21 14:11 JamesBrill