injection icon indicating copy to clipboard operation
injection copied to clipboard

执行npm run test发生错误

Open feiyueXH opened this issue 3 years ago • 1 comments

midway用的是v2的 错误日志如下: 0 info it worked if it ends with ok 1 verbose cli [ 1 verbose cli 'D:\nodejs\node.exe', 1 verbose cli 'D:\nodejs\node_global\node_modules\npm\bin\npm-cli.js', 1 verbose cli 'run', 1 verbose cli 'test' 1 verbose cli ] 2 info using [email protected] 3 info using [email protected] 4 verbose run-script [ 'pretest', 'test', 'posttest' ] 5 info lifecycle [email protected]~pretest: [email protected] 6 info lifecycle [email protected]~test: [email protected] 7 verbose lifecycle [email protected]~test: unsafe-perm in lifecycle true 8 verbose lifecycle [email protected]~test: PATH: D:\nodejs\node_global\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;E:\midway\project\midway_v2_element\node_modules.bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;"D:\java\jdk\bin;D:\java\jdk\jre\bin";D:\nodejs;D:\Program Files\android\build-tools;D:\Program Files\android\tools;D:\Git\cmd;C:\Users\13670\AppData\Local\Microsoft\WindowsApps;D:\nodejs\node_global;D:\Microsoft VS Code\bin 9 verbose lifecycle [email protected]~test: CWD: E:\midway\project\midway_v2_element 10 silly lifecycle [email protected]~test: Args: [ '/d /s /c', 'midway-bin test' ] 11 silly lifecycle [email protected]~test: Returned: code: 1 signal: null 12 info lifecycle [email protected]~test: Failed to exec test script 13 verbose stack Error: [email protected] test: midway-bin test 13 verbose stack Exit status 1 13 verbose stack at EventEmitter. (D:\nodejs\node_global\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16) 13 verbose stack at EventEmitter.emit (events.js:314:20) 13 verbose stack at ChildProcess. (D:\nodejs\node_global\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14) 13 verbose stack at ChildProcess.emit (events.js:314:20) 13 verbose stack at maybeClose (internal/child_process.js:1047:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5) 14 verbose pkgid [email protected] 15 verbose cwd E:\midway\project\midway_v2_element 16 verbose Windows_NT 10.0.18362 17 verbose argv "D:\nodejs\node.exe" "D:\nodejs\node_global\node_modules\npm\bin\npm-cli.js" "run" "test" 18 verbose node v14.11.0 19 verbose npm v6.14.8 20 error code ELIFECYCLE 21 error errno 1 22 error [email protected] test: midway-bin test 22 error Exit status 1 23 error Failed at the [email protected] test script. 23 error This is probably not a problem with npm. There is likely additional logging output above. 24 verbose exit [ 1, true ]

feiyueXH avatar Oct 30 '20 09:10 feiyueXH

感觉是环境问题,你可以换个 cmd,比如 git bash

czy88840616 avatar Oct 30 '20 12:10 czy88840616