Protractor
对我来说运行良好数周,测试 Chrome 和 Firefox 。
然后 Chrome 测试开始失败。
然后Protractor
根本不会运行。
然后根本找不到Protractor
。
然后我无法更新或安装它或其他任何东西。
我是新生的,我真的不知道我在做什么。
几天前,我的经理让我在我的电脑上install Norton AV
。它会以某种方式干扰吗?如果是这样的话,我该怎么办?
当我再次尝试NodeJS
时(在管理员模式下运行。我在管理员内外都试过了),这是install Protractor
的示例错误日志。
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli 'protractor' ]
2 info using npm@2.14.4
3 info using node@v4.1.1
4 verbose install initial load of C:\Users\travi\AppData\Roaming\npm\package.json
5 verbose readDependencies loading dependencies from C:\Users\travi\AppData\Roaming\npm\package.json
6 silly cache add args [ 'protractor', null ]
7 verbose cache add spec protractor
8 silly cache add parsed spec Result {
8 silly cache add raw: 'protractor',
8 silly cache add scope: null,
8 silly cache add name: 'protractor',
8 silly cache add rawSpec: '',
8 silly cache add spec: '*',
8 silly cache add type: 'range' }
9 silly addNamed protractor@*
10 verbose addNamed "*" is a valid semver range for protractor
11 silly addNameRange { name: 'protractor', range: '*', hasData: false }
12 silly mapToRegistry name protractor
13 silly mapToRegistry using default registry
14 silly mapToRegistry registry https://registry.npmjs.org/
15 silly mapToRegistry uri https://registry.npmjs.org/protractor
16 verbose addNameRange registry:https://registry.npmjs.org/protractor not in flight; fetching
17 verbose request uri https://registry.npmjs.org/protractor
18 verbose request no auth needed
19 info attempt registry request try #1 at 9:43:18 PM
20 verbose request id 76486ff9da2422de
21 verbose etag "D0VJJ2AW7ATP99LWOPYEA2JMU"
22 http request GET https://registry.npmjs.org/protractor
23 http 304 https://registry.npmjs.org/protractor
24 silly get cb [ 304,
24 silly get { date: 'Fri, 16 Oct 2015 01:43:15 GMT',
24 silly get via: '1.1 varnish',
24 silly get 'cache-control': 'max-age=60',
24 silly get etag: '"D0VJJ2AW7ATP99LWOPYEA2JMU"',
24 silly get age: '0',
24 silly get connection: 'keep-alive',
24 silly get 'x-served-by': 'cache-iad2121-IAD',
24 silly get 'x-cache': 'HIT',
24 silly get 'x-cache-hits': '1',
24 silly get 'x-timer': 'S1444959795.437579,VS0,VE13',
24 silly get vary: 'Accept' } ]
25 verbose etag https://registry.npmjs.org/protractor from cache
26 verbose get saving protractor to C:\Users\travi\AppData\Roaming\npm-cache\registry.npmjs.org\protractor\.cache.json
27 silly addNameRange number 2 { name: 'protractor', range: '*', hasData: true }
28 silly addNameRange versions [ 'protractor',
28 silly addNameRange [ '0.1.0',
28 silly addNameRange '0.1.1',
28 silly addNameRange '0.1.2',
28 silly addNameRange '0.1.3',
28 silly addNameRange '0.2.0',
28 silly addNameRange '0.2.1',
28 silly addNameRange '0.3.0',
28 silly addNameRange '0.4.0',
28 silly addNameRange '0.4.1',
28 silly addNameRange '0.5.0',
28 silly addNameRange '0.6.1',
28 silly addNameRange '0.7.0',
28 silly addNameRange '0.8.0',
28 silly addNameRange '0.9.0',
28 silly addNameRange '0.10.0',
28 silly addNameRange '0.11.0',
28 silly addNameRange '0.12.0',
28 silly addNameRange '0.12.1',
28 silly addNameRange '0.13.0',
28 silly addNameRange '0.14.0',
28 silly addNameRange '0.15.0',
28 silly addNameRange '0.16.0',
28 silly addNameRange '0.16.1',
28 silly addNameRange '0.17.0',
28 silly addNameRange '0.18.0',
28 silly addNameRange '0.18.1',
28 silly addNameRange '0.19.0',
28 silly addNameRange '0.20.0',
28 silly addNameRange '0.20.1',
28 silly addNameRange '0.21.0',
28 silly addNameRange '0.22.0',
28 silly addNameRange '0.23.0',
28 silly addNameRange '0.23.1',
28 silly addNameRange '0.24.0',
28 silly addNameRange '0.24.1',
28 silly addNameRange '0.24.2',
28 silly addNameRange '1.0.0-rc1',
28 silly addNameRange '1.0.0-rc2',
28 silly addNameRange '1.0.0-rc3',
28 silly addNameRange '1.0.0-rc4',
28 silly addNameRange '1.0.0-rc5',
28 silly addNameRange '1.0.0-rc6',
28 silly addNameRange '1.0.0',
28 silly addNameRange '1.1.0',
28 silly addNameRange '1.1.1',
28 silly addNameRange '1.2.0-beta1',
28 silly addNameRange '1.2.0',
28 silly addNameRange '1.3.0',
28 silly addNameRange '1.3.1',
28 silly addNameRange '1.4.0',
28 silly addNameRange '1.5.0',
28 silly addNameRange '1.6.0',
28 silly addNameRange '1.6.1',
28 silly addNameRange '1.7.0',
28 silly addNameRange '1.8.0',
28 silly addNameRange '2.0.0',
28 silly addNameRange '2.1.0',
28 silly addNameRange '2.2.0',
28 silly addNameRange '2.3.0',
28 silly addNameRange '2.4.0',
28 silly addNameRange '2.5.0',
28 silly addNameRange '2.5.1' ] ]
29 silly addNamed protractor@2.5.1
30 verbose addNamed "2.5.1" is a plain semver version for protractor
31 silly cache afterAdd protractor@2.5.1
32 verbose afterAdd C:\Users\travi\AppData\Roaming\npm-cache\protractor\2.5.1\package\package.json not in flight; writing
33 verbose afterAdd C:\Users\travi\AppData\Roaming\npm-cache\protractor\2.5.1\package\package.json written
34 silly install resolved [ { name: 'protractor',
34 silly install resolved description: 'Webdriver E2E test wrapper for Angular.',
34 silly install resolved homepage: 'https://github.com/angular/protractor',
34 silly install resolved keywords:
34 silly install resolved [ 'angular',
34 silly install resolved 'test',
34 silly install resolved 'testing',
34 silly install resolved 'webdriver',
34 silly install resolved 'webdriverjs',
34 silly install resolved 'selenium' ],
34 silly install resolved author: { name: 'Julie Ralph', email: 'ju.ralph@gmail.com' },
34 silly install resolved dependencies:
34 silly install resolved { request: '~2.57.0',
34 silly install resolved 'selenium-webdriver': '2.47.0',
34 silly install resolved minijasminenode: '1.1.1',
34 silly install resolved jasminewd: '1.1.0',
34 silly install resolved jasminewd2: '0.0.6',
34 silly install resolved jasmine: '2.3.2',
34 silly install resolved saucelabs: '~1.0.1',
34 silly install resolved glob: '~3.2',
34 silly install resolved 'adm-zip': '0.4.4',
34 silly install resolved optimist: '~0.6.0',
34 silly install resolved q: '1.0.0',
34 silly install resolved lodash: '~2.4.1',
34 silly install resolved 'source-map-support': '~0.2.6',
34 silly install resolved 'html-entities': '~1.1.1',
34 silly install resolved 'accessibility-developer-tools': '~2.6.0' },
34 silly install resolved devDependencies:
34 silly install resolved { 'expect.js': '~0.2.0',
34 silly install resolved chai: '~3.3.0',
34 silly install resolved 'chai-as-promised': '~5.1.0',
34 silly install resolved jshint: '2.5.0',
34 silly install resolved mocha: '2.3.3',
34 silly install resolved cucumber: '~0.6.0',
34 silly install resolved express: '~3.3.4',
34 silly install resolved rimraf: '~2.2.6' },
34 silly install resolved repository: { type: 'git', url: 'git://github.com/angular/protractor.git' },
34 silly install resolved bin:
34 silly install resolved { protractor: 'bin/protractor',
34 silly install resolved 'webdriver-manager': 'bin/webdriver-manager' },
34 silly install resolved main: 'lib/protractor.js',
34 silly install resolved scripts:
34 silly install resolved { pretest: 'jshint lib spec scripts',
34 silly install resolved test: 'node scripts/test.js',
34 silly install resolved start: 'node testapp/scripts/web-server.js' },
34 silly install resolved license: 'MIT',
34 silly install resolved version: '2.5.1',
34 silly install resolved gitHead: '645133d557f1059d9e885f2566fc4c29ce7c19cc',
34 silly install resolved bugs: { url: 'https://github.com/angular/protractor/issues' },
34 silly install resolved _id: 'protractor@2.5.1',
34 silly install resolved _shasum: '03d6c93cd7c268f4250177d55a2fec8a198372cd',
34 silly install resolved _from: 'protractor@*',
34 silly install resolved _npmVersion: '2.11.3',
34 silly install resolved _nodeVersion: '0.12.7',
34 silly install resolved _npmUser: { name: 'angularcore', email: 'angular-core+npm@google.com' },
34 silly install resolved dist:
34 silly install resolved { shasum: '03d6c93cd7c268f4250177d55a2fec8a198372cd',
34 silly install resolved tarball: 'http://registry.npmjs.org/protractor/-/protractor-2.5.1.tgz' },
34 silly install resolved maintainers: [ [Object], [Object] ],
34 silly install resolved directories: {},
34 silly install resolved _resolved: 'https://registry.npmjs.org/protractor/-/protractor-2.5.1.tgz',
34 silly install resolved readme: 'ERROR: No README data found!' } ]
35 info install protractor@2.5.1 into C:\Users\travi\AppData\Roaming\npm
36 info installOne protractor@2.5.1
37 verbose installOne of protractor to C:\Users\travi\AppData\Roaming\npm not in flight; installing
38 verbose lock using C:\Users\travi\AppData\Roaming\npm-cache\_locks\protractor-1bab00a4fe7a23a0.lock for C:\Users\travi\AppData\Roaming\npm\node_modules\protractor
39 silly install write writing protractor 2.5.1 to C:\Users\travi\AppData\Roaming\npm\node_modules\protractor
40 verbose unbuild node_modules\protractor
41 silly gentlyRm C:\Users\travi\AppData\Roaming\npm\node_modules\protractor is being purged from base C:\Users\travi\AppData\Roaming\npm
42 verbose gentlyRm don't care about contents; nuking C:\Users\travi\AppData\Roaming\npm\node_modules\protractor
43 silly vacuum-fs purging C:\Users\travi\AppData\Roaming\npm\node_modules\protractor
44 verbose unlock done using C:\Users\travi\AppData\Roaming\npm-cache\_locks\protractor-1bab00a4fe7a23a0.lock for C:\Users\travi\AppData\Roaming\npm\node_modules\protractor
45 verbose stack Error: EPERM: operation not permitted, unlink 'C:\Users\travi\AppData\Roaming\npm\node_modules\protractor\selenium\chromedriver.exe'
45 verbose stack at Error (native)
46 verbose cwd C:\Users\travi\OneDrive\Documents\Protractor\sign in automation - take 1
47 error Windows_NT 10.0.10240
48 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "protractor"
49 error node v4.1.1
50 error npm v2.14.4
51 error path C:\Users\travi\AppData\Roaming\npm\node_modules\protractor\selenium\chromedriver.exe
52 error code EPERM
53 error errno -4048
54 error syscall unlink
55 error Error: EPERM: operation not permitted, unlink 'C:\Users\travi\AppData\Roaming\npm\node_modules\protractor\selenium\chromedriver.exe'
55 error at Error (native)
55 error { [Error: EPERM: operation not permitted, unlink 'C:\Users\travi\AppData\Roaming\npm\node_modules\protractor\selenium\chromedriver.exe']
55 error errno: -4048,
55 error code: 'EPERM',
55 error syscall: 'unlink',
55 error path: 'C:\\Users\\travi\\AppData\\Roaming\\npm\\node_modules\\protractor\\selenium\\chromedriver.exe' }
56 error Please try running this command again as root/Administrator.
57 verbose exit [ -4048, true ]
58 verbose unbuild node_modules\protractor
59 silly gentlyRm C:\Users\travi\AppData\Roaming\npm\node_modules\protractor is being purged from base C:\Users\travi\AppData\Roaming\npm
60 verbose gentlyRm don't care about contents; nuking C:\Users\travi\AppData\Roaming\npm\node_modules\protractor
61 silly vacuum-fs purging C:\Users\travi\AppData\Roaming\npm\node_modules\protractor
62 error error rolling back Error: EPERM: operation not permitted, unlink 'C:\Users\travi\AppData\Roaming\npm\node_modules\protractor\selenium\chromedriver.exe'
62 error error rolling back at Error (native)
62 error error rolling back { [Error: EPERM: operation not permitted, unlink 'C:\Users\travi\AppData\Roaming\npm\node_modules\protractor\selenium\chromedriver.exe']
62 error error rolling back errno: -4048,
62 error error rolling back code: 'EPERM',
62 error error rolling back syscall: 'unlink',
62 error error rolling back path: 'C:\\Users\\travi\\AppData\\Roaming\\npm\\node_modules\\protractor\\selenium\\chromedriver.exe' }
#
更新:
我曾多次尝试npm cache clean
,但后来我deleted the contents of %appdata%/npm-cache
Per Nocturno,现在我就在这里:
C:\Users\travi>npm cache clean
C:\Users\travi>Protractor
'Protractor' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\travi>npm install protractor
> utf-8-validate@1.2.1 install C:\Users\travi\node_modules\protractor\node_modules\selenium-webdriver\node_modules\ws\node_modules\utf-8-validate
> node-gyp rebuild
C:\Users\travi\node_modules\protractor\node_modules\selenium-webdriver\node_modules\ws\node_modules\utf-8-validate>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(366,5): warning MSB8003: Could not fi
nd WindowsSDKDir variable from the registry. TargetFrameworkVersion or PlatformToolset may be set to an invalid versio
n number. [C:\Users\travi\node_modules\protractor\node_modules\selenium-webdriver\node_modules\ws\node_modules\utf-8-va
lidate\build\validation.vcxproj]
TRACKER : error TRK0005: Failed to locate: "CL.exe". The system cannot find the file specified. [C:\Users\travi\node_mo
dules\protractor\node_modules\selenium-webdriver\node_modules\ws\node_modules\utf-8-validate\build\validation.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:270:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 10.0.10240
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\travi\node_modules\protractor\node_modules\selenium-webdriver\node_modules\ws\node_modules\utf-8-validate
gyp ERR! node -v v4.1.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
> bufferutil@1.2.1 install C:\Users\travi\node_modules\protractor\node_modules\selenium-webdriver\node_modules\ws\node_modules\bufferutil
> node-gyp rebuild
答案 0 :(得分:0)
第45行看到的错误EPERM是一个npm权限错误。可以使用npm cache clean
修复,然后您可能必须删除%APPDATA%\npm-cache
目录中的所有内容。