Reputation: 21
We are working at a project where we connect to services such as Google speech to text and AWS, everything works splendid when running locally but deployment faile on Azure side with very weird errors:
Running 'npm install' ...
> [email protected] install /home/site/wwwroot/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library
internal/modules/cjs/loader.js:583
throw err;
^
Error: Cannot find module '../'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/home/site/wwwroot/node_modules/grpc/node_modules/node-pre-gyp/bin/node-pre-gyp:15:20)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/home/site/wwwroot/node_modules/grpc/node_modules/fs-minipass'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/home/site/wwwroot/node_modules/grpc/node_modules/wide-align'
then what follows are a lot of ENOTEMPTY: directory not empty errors. These errors do not happen when running locally.
As for the "directory not empty" we have read some posts talking about disabling the virus software and closing some apps running but to no avail. We do not understand why Azure or npm assumes "../" is a module either, it is not.
The proplems started to happen when we deployed things google related, before that point everything was working:
class Google {
async getTextFromAudio(audioFile) {
const client = new speech.SpeechClient();
const audio = {
content: audioFile
};
const config = {
encoding: 'FLAC',
languageCode: 'is-IS'
};
const request = {
audio: audio,
config: config
}
const [response] = await client.recognize(request);
const transcription = response.results
.map(result => result.alternatives[0].transcript)
.join('\n');
return transcription;
}
}
module.exports = Google;
We have not setup the google credentials for Azure so we were expecting getting an error having something to do with that, it does not reach that point and seems to get errors before reaching that point. We even tried taking the code out that started these errors and deploy again but it doesnt fixx the error. Anybody else gotten similar errors?
Upvotes: 1
Views: 2371
Reputation: 5294
It's related to the node version, if you are using 9.** or higher version. Please degrade it to lower version to make it work.
There is similar thread for the issue posted .
Hope it helps.
Upvotes: 1