【发布时间】:2021-01-02 20:46:27
【问题描述】:
我有一段代码可以打开一个新的弹出窗口并触发打印。打印工作正常,但是当我关闭弹出窗口时,应用程序崩溃并从我的终端显示“This is probably not a problem with npm. There is likely additional logging output above.”的错误
var img = jQuery("#imgWrap").html();
var popup = window.open();
console.log(popup);
popup.focus();
popup.document.write(img);
popup.print();
这是完整的日志输出
0 info it worked if it ends with ok
1 verbose cli [
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 'start'
1 verbose cli ]
2 info using npm@6.14.8
3 info using node@v14.11.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle electron-photobooth@1.0.0~prestart: electron-photobooth@1.0.0
6 info lifecycle electron-photobooth@1.0.0~start: electron-photobooth@1.0.0
7 verbose lifecycle electron-photobooth@1.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle electron-photobooth@1.0.0~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\a_bee\Documents\apps\ElectronPhotobooth\node_modules\.bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\TortoiseSVN\bin;C:\Program Files\nodejs\;C:\Users\a_bee\AppData\Local\Microsoft\WindowsApps;;C:\Users\a_bee\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\a_bee\AppData\Roaming\npm
9 verbose lifecycle electron-photobooth@1.0.0~start: CWD: C:\Users\a_bee\Documents\apps\ElectronPhotobooth
10 silly lifecycle electron-photobooth@1.0.0~start: Args: [ '/d /s /c', 'electron .' ]
11 silly lifecycle electron-photobooth@1.0.0~start: Returned: code: 3221226505 signal: null
12 info lifecycle electron-photobooth@1.0.0~start: Failed to exec start script
13 verbose stack Error: electron-photobooth@1.0.0 start: `electron .`
13 verbose stack Exit status 3221226505
13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\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.<anonymous> (C:\Program Files\nodejs\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 electron-photobooth@1.0.0
15 verbose cwd C:\Users\a_bee\Documents\apps\ElectronPhotobooth
16 verbose Windows_NT 10.0.18363
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v14.11.0
19 verbose npm v6.14.8
20 error code ELIFECYCLE
21 error errno 3221226505
22 error electron-photobooth@1.0.0 start: `electron .`
22 error Exit status 3221226505
23 error Failed at the electron-photobooth@1.0.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 3221226505, true ]
【问题讨论】:
-
也许尝试
npm install然后再次运行代码?如果还是不行,可能需要清除缓存,这种情况下,删除node_modules文件夹,运行npm cache verify,然后n运行npm install -
There is likely additional logging output above."... 那么上面还有额外的日志输出吗?如果可以,可以分享给我们吗? -
在问题中添加了完整的日志输出:)
-
我很好奇你为什么将
src设置为#;你希望它做什么? -
我只是把它放在示例代码中。我复制了我的代码并更改了我的问题以反映我的实际代码。
标签: javascript node.js electron