在进行desktop打包过程中,遇到如下报错:
0 info it worked if it ends with ok 1 verbose cli [ 'C:\Program Files\nodejs\node.exe', 1 verbose cli 'C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js', 1 verbose cli 'start' ] 2 info using npm@3.10.5 3 info using node@v6.3.0 4 verbose run-script [ 'prestart', 'start', 'poststart' ] 5 info lifecycle lifeccp-desktop@1.1.9~prestart: lifeccp-desktop@1.1.9 6 silly lifecycle lifeccp-desktop@1.1.9~prestart: no script for prestart, continuing 7 info lifecycle lifeccp-desktop@1.1.9~start: lifeccp-desktop@1.1.9 8 verbose lifecycle lifeccp-desktop@1.1.9~start: unsafe-perm in lifecycle true 9 verbose lifecycle lifeccp-desktop@1.1.9~start: PATH: C:UsersAdministratorAppDataRoaming pm ode_modules pmin ode-gyp-bin;E:CodeSpaceSCM_TESTdesktop ode_modules.bin;C:Program Files odejs;C:ProgramDataOracleJavajavapath;C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem;C:WINDOWSSystem32WindowsPowerShellv1.0;C:ProgramJAVAjdk1.8.0_91in;C:ProgramANTapache-ant-1.9.7in;C:Program Files odejs;C:Program FilesGitcmd;C:Program FilesGitmingw64in;C:Program FilesGitusrin;C:ProgramDicomViewerWanLiYunDiagonseBin;C:UsersAdministratorAppDataRoaming pm;C:Python27;C:ProgramDicomViewerWanLiYunDiagonseBin 10 verbose lifecycle lifeccp-desktop@1.1.9~start: CWD: E:CodeSpaceSCM_TESTdesktop 11 silly lifecycle lifeccp-desktop@1.1.9~start: Args: [ '/d /s /c', 'electron app' ] 12 silly lifecycle lifeccp-desktop@1.1.9~start: Returned: code: 1 signal: null 13 info lifecycle lifeccp-desktop@1.1.9~start: Failed to exec start script 14 verbose stack Error: lifeccp-desktop@1.1.9 start: `electron app` 14 verbose stack Exit status 1 14 verbose stack at EventEmitter.<anonymous> (C:UsersAdministratorAppDataRoaming pm ode_modules pmlibutilslifecycle.js:242:16) 14 verbose stack at emitTwo (events.js:106:13) 14 verbose stack at EventEmitter.emit (events.js:191:7) 14 verbose stack at ChildProcess.<anonymous> (C:UsersAdministratorAppDataRoaming pm ode_modules pmlibutilsspawn.js:40:14) 14 verbose stack at emitTwo (events.js:106:13) 14 verbose stack at ChildProcess.emit (events.js:191:7) 14 verbose stack at maybeClose (internal/child_process.js:852:16) 14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5) 15 verbose pkgid lifeccp-desktop@1.1.9 16 verbose cwd E:CodeSpaceSCM_TESTdesktop 17 error Windows_NT 10.0.10586 18 error argv "C:\Program Files\nodejs\node.exe" "C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "start" 19 error node v6.3.0 20 error npm v3.10.5 21 error code ELIFECYCLE 22 error lifeccp-desktop@1.1.9 start: `electron app` 22 error Exit status 1 23 error Failed at the lifeccp-desktop@1.1.9 start script 'electron app'. 23 error Make sure you have the latest version of node.js and npm installed. 23 error If you do, this is most likely a problem with the lifeccp-desktop package, 23 error not with npm itself. 23 error Tell the author that this fails on your system: 23 error electron app 23 error You can get information on how to open an issue for this project with: 23 error npm bugs lifeccp-desktop 23 error Or if that isn't available, you can get their info via: 23 error npm owner ls lifeccp-desktop 23 error There is likely additional logging output above. 24 verbose exit [ 1, true ]
看到 stackoverflow 上面 http://stackoverflow.com/questions/35040729/running-npm-install-g-yo-command-gives-npm-err-windows-nt-6-1-7601/35043377#35043377 有这个解决办法:
This is how I solved the issue on Windows 8.1
- Go to your nodejs install (usually C:Program Files odejs)
- Right click node_modules folder and go to properties
- Click the Security tab and advanced
- At the top you will see "Owner: SYSTEM". Click change.
- Enter the user you want permissions for and click ok
- Check the box at the bottom of the advanced settings "Replace all child object permission entries with inheritable permission entries from this object" and click ok
- Do whatever npm install/update you need
(另一个关于electron的问题:http://www.cnblogs.com/haochuang/p/5688093.html)
用该办法尝试,但未解决,再次尝试其他办法;