midwayjs / injection

Injection is a powerful inversion of control container that is widely used in the midway framework and brings good user experience.
MIT License
160 stars 20 forks source link

执行npm run test发生错误 #49

Open feiyueXH opened 4 years ago

feiyueXH commented 4 years ago

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 npm@6.14.8 3 info using node@v14.11.0 4 verbose run-script [ 'pretest', 'test', 'posttest' ] 5 info lifecycle my_midway_project@1.0.0~pretest: my_midway_project@1.0.0 6 info lifecycle my_midway_project@1.0.0~test: my_midway_project@1.0.0 7 verbose lifecycle my_midway_project@1.0.0~test: unsafe-perm in lifecycle true 8 verbose lifecycle my_midway_project@1.0.0~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 my_midway_project@1.0.0~test: CWD: E:\midway\project\midway_v2_element 10 silly lifecycle my_midway_project@1.0.0~test: Args: [ '/d /s /c', 'midway-bin test' ] 11 silly lifecycle my_midway_project@1.0.0~test: Returned: code: 1 signal: null 12 info lifecycle my_midway_project@1.0.0~test: Failed to exec test script 13 verbose stack Error: my_midway_project@1.0.0 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 my_midway_project@1.0.0 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 my_midway_project@1.0.0 test: midway-bin test 22 error Exit status 1 23 error Failed at the my_midway_project@1.0.0 test script. 23 error This is probably not a problem with npm. There is likely additional logging output above. 24 verbose exit [ 1, true ]

czy88840616 commented 4 years ago

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