0

It's my first practical expirience in using of npm package manager so don't beat me : ). Running npm at windows 8 I faced with a error which could not fix.

That's what I got: npm error

As you can see, script throwed an error when faced with "." symbol. Think it's because windows does not support partial links like "./bla/blabla/blablabla". Also by some reason the path to webdriver-manager seems to be broken. It starts with 'C:\' and ends with './node' because the symbol '>' (dunno how to name it) separates them in two lines. Still do not understand how to fix it on windows 8. Suppose that webdriver-manager script thinks that './node_modules/protractor/bin/webdriver-manager' is the absolute path to this script.

4

1 回答 1

0

这似乎是一个尚未解决的老问题。希望这会有所帮助。

您看到的错误来自 package.json 文件中的“webdriver-manager-update”脚本。我想你的脚本标签看起来像:

"scripts" {
    "webdriver-manager-update": "./node_modules/protractor/bin/webdriver-manager update"
}

这适用于 linux 和 mac,但不适用于 Windows 机器。在其 package.json 中注册可执行二进制文件(使用“bin”关键字)的包将在其“node_modules/.bin”文件夹中注册符号链接/快捷方式。Node 知道此路径,因此您只需将脚本更改为:

"scripts" {
    "webdriver-manager-update": "webdriver-manager update"
}

然后你可以运行它:npm run webdriver-manager-update

如果您需要从文件路径启动此命令,而无需在 package.json 的“脚本”部分注册命令,那么您将执行以下操作:

node node_modules/protractor/bin/webdriver-manager update
于 2017-03-12T19:22:45.173 回答