Error when installing microsoft-cognitiveservices-speech-sdk
2lach opened this issue · comments
Please provide us with the following information:
This issue is for a: (mark with an x
)
- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)
Minimal steps to reproduce
git clone https://github.com/Azure-Samples/js-e2e-express-server
cd js-e2e-express-server
npm install
Here comes the bug:npm install microsoft-cognitiveservices-speech-sdk
Any log messages given by the failure
npm ERR! code 1
npm ERR! path /Users/stefan/projects/Talk2Me/node_modules/microsoft-cognitiveservices-speech-sdk
npm ERR! command failed
npm ERR! command sh -c npm install --package-lock-only --ignore-scripts --no-audit && npx npm-force-resolutions
npm ERR! up to date in 4s
npm ERR! Error: Cannot find module '/Users/stefan/.config/.npm/_npx/73b02210abc194ff/node_modules/.bin/out/goog/bootstrap/nodejs.js'
npm ERR! Require stack:
npm ERR! - /Users/stefan/.config/.npm/_npx/73b02210abc194ff/node_modules/.bin/npm-force-resolutions
npm ERR! at Function.Module._resolveFilename (node:internal/modules/cjs/loader:985:15)
npm ERR! at Function.Module._load (node:internal/modules/cjs/loader:833:27)
npm ERR! at Module.require (node:internal/modules/cjs/loader:1057:19)
npm ERR! at require (node:internal/modules/cjs/helpers:103:18)
npm ERR! at Object. (/Users/stefan/.config/.npm/_npx/73b02210abc194ff/node_modules/.bin/npm-force-resolutions:19:1)
npm ERR! at Module._compile (node:internal/modules/cjs/loader:1155:14)
npm ERR! at Object.Module._extensions..js (node:internal/modules/cjs/loader:1209:10)
npm ERR! at Module.load (node:internal/modules/cjs/loader:1033:32)
npm ERR! at Function.Module._load (node:internal/modules/cjs/loader:868:12)
npm ERR! at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
Expected/desired behavior
npm install should be succesful since i found this in a tutorial about
Cognitive Services Speech
OS and Version?
OS: macOS 13.0 22A380 x86_64
Host: MacBookPro16,1
Versions
ᐅ node --version
v16.18.0
ᐅ npm --version
9.1.2
Mention any other details that might be useful
found a workaround:
first add these to "scripts" section
preinstall
setup
then add the microsoft-cognitiveservices-speech-sdk
package directly among depencies
# package.json
"scripts": {
"preinstall": "npm install -g npm-force-resolutions@0.0.3",
....
"setup": "npm install --package-lock-only --ignore-scripts --no-audit"
},
"dependencies": {
....
"microsoft-cognitiveservices-speech-sdk": "^1.24.0"
},
}
then run:
rm -rf node_modules && npm cache verify && npm install
this will most likely fail
however if you then run
yarn install
the installation will be succesful
then the app works locally assuming the Create Cognitive Services Speech resource have been created :)
because the section:
Deploy local Express.js app to remote App service in Visual Studio Code
fails during deployment
Have a nice day
Thanks! We'll be in touch soon.