Node.js 在WSL上安装twilio cli

Node.js 在WSL上安装twilio cli,node.js,npm,twilio,keytar,twilio-cli,Node.js,Npm,Twilio,Keytar,Twilio Cli,使用npm安装-g twilio cli安装twilio cli时,会出现错误 我安装了nvm和node 10,并将npm与之一起使用,它安装了twilio cli,但我仍然收到错误消息 npm install -g twilio-cli /home/elephantatech/.nvm/versions/node/v10.19.0/bin/twilio -> /home/elephantatech/.nvm/versions/node/v10.19.0/lib/node_modules

使用npm安装-g twilio cli安装twilio cli时,会出现错误

我安装了nvm和node 10,并将npm与之一起使用,它安装了twilio cli,但我仍然收到错误消息

 npm install -g twilio-cli
/home/elephantatech/.nvm/versions/node/v10.19.0/bin/twilio -> /home/elephantatech/.nvm/versions/node/v10.19.0/lib/node_modules/twilio-cli/bin/run

> keytar@4.13.0 install /home/elephantatech/.nvm/versions/node/v10.19.0/lib/node_modules/twilio-cli/node_modules/keytar
> prebuild-install || node-gyp rebuild

prebuild-install WARN install libsecret-1.so.0: cannot open shared object file: No such file or directory
Package libsecret-1 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libsecret-1.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libsecret-1' found
gyp: Call to 'pkg-config --libs-only-l libsecret-1' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/home/elephantatech/.nvm/versions/node/v10.19.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 4.4.0-19041-Microsoft
gyp ERR! command "/home/elephantatech/.nvm/versions/node/v10.19.0/bin/node" "/home/elephantatech/.nvm/versions/node/v10.19.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/elephantatech/.nvm/versions/node/v10.19.0/lib/node_modules/twilio-cli/node_modules/keytar
gyp ERR! node -v v10.19.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok

> ngrok@3.2.7 postinstall /home/elephantatech/.nvm/versions/node/v10.19.0/lib/node_modules/twilio-cli/node_modules/ngrok
> node ./postinstall.js

ngrok - downloading binary https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
ngrok - downloading progress: 13773305/13773305
ngrok - binary downloaded to /home/elephantatech/.ngrok/aHR0cHM6Ly9iaW4uZXF1aW5veC5pby9jLzRWbUR6QTdpYUhiL25ncm9rLXN0YWJsZS1saW51eC1hbWQ2NC56aXA=.zip
ngrok - unpacking binary
ngrok - binary unpacked to /home/elephantatech/.nvm/versions/node/v10.19.0/lib/node_modules/twilio-cli/node_modules/ngrok/bin/ngrok

> twilio-cli@1.9.6 postinstall /home/elephantatech/.nvm/versions/node/v10.19.0/lib/node_modules/twilio-cli
> node welcome.js


*************************************************************************
*                                                                       *
* To get started, please create a twilio-cli profile:                   *
*                                                                       *
*     twilio login                                                      *
*                                                                       *
*     OR                                                                *
*                                                                       *
*     twilio profiles:create                                            *
*                                                                       *
*************************************************************************

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: keytar@4.13.0 (node_modules/twilio-cli/node_modules/keytar):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: keytar@4.13.0 install: `prebuild-install || node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

+ twilio-cli@1.9.6
added 609 packages from 1397 contributors in 79.067s
我试图安装keytar软件包,但出现以下错误

npm install -g keytar

> keytar@5.4.0 install /home/elephantatech/.nvm/versions/node/v10.19.0/lib/node_modules/keytar
> prebuild-install || node-gyp rebuild

prebuild-install WARN install libsecret-1.so.0: cannot open shared object file: No such file or directory
Package libsecret-1 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libsecret-1.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libsecret-1' found
gyp: Call to 'pkg-config --libs-only-l libsecret-1' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/home/elephantatech/.nvm/versions/node/v10.19.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 4.4.0-19041-Microsoft
gyp ERR! command "/home/elephantatech/.nvm/versions/node/v10.19.0/bin/node" "/home/elephantatech/.nvm/versions/node/v10.19.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/elephantatech/.nvm/versions/node/v10.19.0/lib/node_modules/keytar
gyp ERR! node -v v10.19.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! keytar@5.4.0 install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the keytar@5.4.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

我需要通过WSL使用twilio cli的帮助。纯windows很好,但对于一些我试图与WSL一起使用的脚本来说。

在我看来它已经安装,只是keytar失败了,这是一个可选的依赖项。由于keytar不可用,您可以使用env vars来存储/访问凭据:

在我看来它已安装,只是keytar失败了,这是一个可选的依赖项。由于keytar不可用,您可以使用env vars存储/访问凭据:

我认为这是根本原因(从错误日志中提取):

我也遇到了同样的问题,通过安装
libsecret
,修复了这个问题,对于debian/ubuntu,您可以运行:

sudo apt-get install libsecret-1-dev

更多信息:

我认为这是根本原因(从错误日志中摘录):

我也遇到了同样的问题,通过安装
libsecret
,修复了这个问题,对于debian/ubuntu,您可以运行:

sudo apt-get install libsecret-1-dev

更多信息:

我知道如何进行设置。我只需要对多个配置文件执行此操作,但我现在只创建一个脚本。我知道如何进行设置。我只需要对多个配置文件执行此操作,但我现在只创建一个脚本。