npm 打包 electron app 报错问题
在进行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:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin;E:\CodeSpace\SCM_TEST\desktop\node_modules\.bin;C:\Program Files\nodejs;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program\JAVA\jdk1.8.0_91\bin;C:\Program\ANT\apache-ant-1.9.7\bin;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Program\DicomViewer\WanLiYunDiagonse\Bin;C:\Users\Administrator\AppData\Roaming\npm;C:\Python27;C:\Program\DicomViewer\WanLiYunDiagonse\Bin 10 verbose lifecycle lifeccp-desktop@1.1.9~start: CWD: E:\CodeSpace\SCM_TEST\desktop 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:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\lib\utils\lifecycle.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:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\lib\utils\spawn.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:\CodeSpace\SCM_TEST\desktop 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\nodejs)
- 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)
用该办法尝试,但未解决,再次尝试其他办法;
![](http://files.cnblogs.com/files/haochuang/alipay-RedEnvelopes.bmp)
赠人玫瑰
手留余香
我们曾如此渴望命运的波澜,到最后才发现:人生最曼妙的风景,竟是内心的淡定与从容……我们曾如此期盼外界的认可,到最后才知道:世界是自己的,与他人毫无关系!-杨绛先生
如果,您希望更容易地发现我的新博客,不妨点击一下绿色通道的