未解决的依赖项npm run watch

时间:2018-09-15 23:05:48

标签: javascript node.js webpack

我正在尝试导入这样的模块:

const speech = require('@google-cloud/speech');

当我运行“ npm run watch”时,出现了很多这样的错误:

ERROR in ./node_modules/@grpc/grpc-js/build/src/channel-credentials.js
Module not found: Error: Can't resolve 'tls' in ...

ERROR in ./node_modules/forever-agent/index.js
Module not found: Error: Can't resolve 'tls' in ...

ERROR in ./node_modules/tunnel-agent/index.js
Module not found: Error: Can't resolve 'tls' in ...

似乎我无法解决某些依赖关系,但不确定如何解决此问题。

我跑了

~/learn-node $ node
> module.paths

检查包含@ google-cloud / speech的文件夹是否在所搜索的路径之一中。

** NEW warnings:

WARNING in ./node_modules/ws/lib/Validation.js
Module not found: Error: Can't resolve 'utf-8-validate' in ...

WARNING in ./node_modules/ws/lib/BufferUtil.js
Module not found: Error: Can't resolve 'bufferutil' in ...

WARNING in ./node_modules/bytebuffer/dist/bytebuffer-node.js
Module not found: Error: Can't resolve 'memcpy' in ...

WARNING in ./node_modules/grpc/src/grpc_extension.js 32:12-33
Critical dependency: the request of a dependency is an expression

0 个答案:

没有答案