Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 安装webdriverio节点时无法找到依赖项_Node.js_Npm_Npm Install_Webdriver Io - Fatal编程技术网

Node.js 安装webdriverio节点时无法找到依赖项

Node.js 安装webdriverio节点时无法找到依赖项,node.js,npm,npm-install,webdriver-io,Node.js,Npm,Npm Install,Webdriver Io,使用npm安装模块webdriverio时,我遇到以下错误: sudo npm install webdriverio [sudo] password for username: npm WARN package.json indexof@0.0.1 No repository field. npm http GET https://registry.npmjs.org/webdriverio npm http 304 https://registry.npmjs.org/webdriveri

使用
npm
安装模块
webdriverio
时,我遇到以下错误:

sudo npm install webdriverio
[sudo] password for username: 
npm WARN package.json indexof@0.0.1 No repository field.
npm http GET https://registry.npmjs.org/webdriverio
npm http 304 https://registry.npmjs.org/webdriverio
npm WARN engine webdriverio@5.4.9: wanted: {"node":">= 4.8.5"} (current: {"node":"v0.10.15","npm":"1.3.5"})
npm http GET https://registry.npmjs.org/grapheme-splitter
npm http GET https://registry.npmjs.org/css-value
npm http GET https://registry.npmjs.org/lodash.merge
npm http GET https://registry.npmjs.org/lodash.zip
npm http GET https://registry.npmjs.org/rgb2hex
npm http GET https://registry.npmjs.org/serialize-error
npm http GET https://registry.npmjs.org/webdriver
npm http GET https://registry.npmjs.org/wdio/logger
npm http GET https://registry.npmjs.org/wdio/config
npm http GET https://registry.npmjs.org/wdio/repl
npm http 304 https://registry.npmjs.org/css-value
npm ERR! Error: No compatible version found: css-value@'^0.0.1'
npm ERR! Valid install targets:
npm ERR! ["0.0.1"]
npm ERR!     at installTargetsError (/usr/local/lib/node_modules/npm/lib/cache.js:719:10)
npm ERR!     at /usr/local/lib/node_modules/npm/lib/cache.js:638:10
npm ERR!     at saved (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/get.js:142:7)
npm ERR!     at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:133:7
npm ERR!     at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Linux 4.15.0-43-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "webdriverio"
npm ERR! cwd /home/username/research
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm http 304 https://registry.npmjs.org/lodash.merge
npm http 304 https://registry.npmjs.org/serialize-error
npm http 304 https://registry.npmjs.org/lodash.zip
npm http 304 https://registry.npmjs.org/grapheme-splitter
npm http 304 https://registry.npmjs.org/webdriver
npm http 304 https://registry.npmjs.org/rgb2hex
npm http 405 https://registry.npmjs.org/wdio/repl
npm ERR! TypeError: Object.keys called on non-object
npm ERR!     at Function.keys (native)
npm ERR!     at installTargetsError (/usr/local/lib/node_modules/npm/lib/cache.js:708:24)
npm ERR!     at /usr/local/lib/node_modules/npm/lib/cache.js:638:10
npm ERR!     at saved (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/get.js:142:7)
npm ERR!     at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:133:7
npm ERR!     at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Linux 4.15.0-43-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "webdriverio"
npm ERR! cwd /home/username/research
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! type called_on_non_object
npm http 405 https://registry.npmjs.org/wdio/logger
npm ERR! TypeError: Object.keys called on non-object
npm ERR!     at Function.keys (native)
npm ERR!     at installTargetsError (/usr/local/lib/node_modules/npm/lib/cache.js:708:24)
npm ERR!     at /usr/local/lib/node_modules/npm/lib/cache.js:638:10
npm ERR!     at saved (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/get.js:142:7)
npm ERR!     at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:133:7
npm ERR!     at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Linux 4.15.0-43-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "webdriverio"
npm ERR! cwd /home/username/research
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! type called_on_non_object
npm http 405 https://registry.npmjs.org/wdio/config
npm ERR! TypeError: Object.keys called on non-object
npm ERR!     at Function.keys (native)
npm ERR!     at installTargetsError (/usr/local/lib/node_modules/npm/lib/cache.js:708:24)
npm ERR!     at /usr/local/lib/node_modules/npm/lib/cache.js:638:10
npm ERR!     at saved (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/get.js:142:7)
npm ERR!     at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:133:7
npm ERR!     at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Linux 4.15.0-43-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "webdriverio"
npm ERR! cwd /home/username/research
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! type called_on_non_object
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/username/research/npm-debug.log
npm ERR! not ok code 0
sudo npm安装webdriverio
[sudo]用户名的密码:
npm WARN package.jsonindexof@0.0.1没有存储库字段。
npm http GEThttps://registry.npmjs.org/webdriverio
npm http 304https://registry.npmjs.org/webdriverio
警告引擎webdriverio@5.4.9:通缉:{“节点”:“>=4.8.5”}(当前:{“节点”:“v0.10.15”,“npm”:“1.3.5”})
npm http GEThttps://registry.npmjs.org/grapheme-splitter
npm http GEThttps://registry.npmjs.org/css-value
npm http GEThttps://registry.npmjs.org/lodash.merge
npm http GEThttps://registry.npmjs.org/lodash.zip
npm http GEThttps://registry.npmjs.org/rgb2hex
npm http GEThttps://registry.npmjs.org/serialize-error
npm http GEThttps://registry.npmjs.org/webdriver
npm http GEThttps://registry.npmjs.org/wdio/logger
npm http GEThttps://registry.npmjs.org/wdio/config
npm http GEThttps://registry.npmjs.org/wdio/repl
npm http 304https://registry.npmjs.org/css-value
npm错误!错误:找不到兼容版本:css值“^0.0.1”
npm错误!有效的安装目标:
npm错误!["0.0.1"]
npm错误!在installTargetsError(/usr/local/lib/node_modules/npm/lib/cache.js:719:10)
npm错误!在/usr/local/lib/node_modules/npm/lib/cache.js:638:10
npm错误!保存时(/usr/local/lib/node_modules/npm/node_modules/npm registry client/lib/get.js:142:7)
npm错误!at/usr/local/lib/node_modules/npm/node_modules/destanced fs/polyfills.js:133:7
npm错误!在Object.oncomplete(fs.js:107:15)
npm错误!如果需要帮助,您可以在以下位置报告此日志:
npm错误!
npm错误!或通过电子邮件发送至:
npm错误!
npm错误!Linux系统4.15.0-43-generic
npm错误!命令“/usr/local/bin/node”“/usr/local/bin/npm”“安装”“webdriverio”
npm错误!cwd/主页/用户名/研究
npm错误!节点-v v0.10.15
npm错误!npm-V1.3.5
npm http 304https://registry.npmjs.org/lodash.merge
npm http 304https://registry.npmjs.org/serialize-error
npm http 304https://registry.npmjs.org/lodash.zip
npm http 304https://registry.npmjs.org/grapheme-splitter
npm http 304https://registry.npmjs.org/webdriver
npm http 304https://registry.npmjs.org/rgb2hex
npm http 405https://registry.npmjs.org/wdio/repl
npm错误!TypeError:在非对象上调用Object.keys
npm错误!at Function.keys(本机)
npm错误!installTargetsError(/usr/local/lib/node_modules/npm/lib/cache.js:708:24)
npm错误!在/usr/local/lib/node_modules/npm/lib/cache.js:638:10
npm错误!保存时(/usr/local/lib/node_modules/npm/node_modules/npm registry client/lib/get.js:142:7)
npm错误!at/usr/local/lib/node_modules/npm/node_modules/destanced fs/polyfills.js:133:7
npm错误!在Object.oncomplete(fs.js:107:15)
npm错误!如果需要帮助,您可以在以下位置报告此日志:
npm错误!
npm错误!或通过电子邮件发送至:
npm错误!
npm错误!Linux系统4.15.0-43-generic
npm错误!命令“/usr/local/bin/node”“/usr/local/bin/npm”“安装”“webdriverio”
npm错误!cwd/主页/用户名/研究
npm错误!节点-v v0.10.15
npm错误!npm-V1.3.5
npm错误!在\u非\u对象上调用的类型
npm http 405https://registry.npmjs.org/wdio/logger
npm错误!TypeError:在非对象上调用Object.keys
npm错误!at Function.keys(本机)
npm错误!installTargetsError(/usr/local/lib/node_modules/npm/lib/cache.js:708:24)
npm错误!在/usr/local/lib/node_modules/npm/lib/cache.js:638:10
npm错误!保存时(/usr/local/lib/node_modules/npm/node_modules/npm registry client/lib/get.js:142:7)
npm错误!at/usr/local/lib/node_modules/npm/node_modules/destanced fs/polyfills.js:133:7
npm错误!在Object.oncomplete(fs.js:107:15)
npm错误!如果需要帮助,您可以在以下位置报告此日志:
npm错误!
npm错误!或通过电子邮件发送至:
npm错误!
npm错误!Linux系统4.15.0-43-generic
npm错误!命令“/usr/local/bin/node”“/usr/local/bin/npm”“安装”“webdriverio”
npm错误!cwd/主页/用户名/研究
npm错误!节点-v v0.10.15
npm错误!npm-V1.3.5
npm错误!在\u非\u对象上调用的类型
npm http 405https://registry.npmjs.org/wdio/config
npm错误!TypeError:在非对象上调用Object.keys
npm错误!at Function.keys(本机)
npm错误!installTargetsError(/usr/local/lib/node_modules/npm/lib/cache.js:708:24)
npm错误!在/usr/local/lib/node_modules/npm/lib/cache.js:638:10
npm错误!保存时(/usr/local/lib/node_modules/npm/node_modules/npm registry client/lib/get.js:142:7)
npm错误!at/usr/local/lib/node_modules/npm/node_modules/destanced fs/polyfills.js:133:7
npm错误!在Object.oncomplete(fs.js:107:15)
npm错误!如果需要帮助,您可以在以下位置报告此日志:
npm错误!
npm错误!或通过电子邮件发送至:
npm错误!
npm错误!Linux系统4.15.0-43-generic
npm错误!命令“/usr/local/bin/node”“/usr/local/bin/npm”“安装”“webdriverio”
npm错误!cwd/主页/用户名/研究
npm错误!节点-v v0.10.15
npm错误!npm-V1.3.5
npm错误!在\u非\u对象上调用的类型
npm错误!
npm错误!其他日志记录详细信息可在以下位置找到:
npm错误/home/username/research/npm-debug.log
npm错误!不正常代码0
有人能帮忙吗?我不明白为什么会发生这种情况,因为当我执行
npm info loadash.merge
时,模块版本明显存在。我还尝试查看了我的
$NODE\u路径包含的内容(正如
stackoverflow
上的一些回答所建议的),它似乎指向
节点的正确路径,或者至少指向安装
nvm
的路径
节点

/home/username/.nvm/versions/node/v10.15.1/bin/node

此外,我不确定这一警告:
npm警告引擎webdriverio@5.4.9:通缉:{“节点”:“>=4.8.5”}(当前:{“节点”:“v0.10.15”,“npm”:“1.3.5”})
我的节点版本是
10.15.1
,而不是
0.10.15

我认为您缺少基于堆栈跟踪这一部分的css值库:

npm错误!错误:找不到兼容的版本
sudo su
nvm alias default 10.15.1
npm cache clean --force
npm install webdriverio
npm install webdriverio --unsafe-perm