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 [email protected]
3 info using [email protected]
4 verbose run-script [ ‘prestart‘, ‘start‘, ‘poststart‘ ]
5 info lifecycle [email protected]~prestart: [email protected]
6 silly lifecycle [email protected]~prestart: no script for prestart, continuing
7 info lifecycle [email protected]~start: [email protected]
8 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
9 verbose lifecycle [email protected]~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 [email protected]~start: CWD: E:\CodeSpace\SCM_TEST\desktop
11 silly lifecycle [email protected]~start: Args: [ ‘/d /s /c‘, ‘electron app‘ ]
12 silly lifecycle [email protected]~start: Returned: code: 1  signal: null
13 info lifecycle [email protected]~start: Failed to exec start script
14 verbose stack Error: [email protected] 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 [email protected]
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 [email protected] start: `electron app`
22 error Exit status 1
23 error Failed at the [email protected] 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

用该办法尝试,但未解决,再次尝试其他办法;

时间: 2024-12-08 02:52:55

npm 打包 electron app 报错问题的相关文章

使用webpack命令打包时,报错TypeError: Cannot read property &#39;presetToOptions&#39; of undefined的解决办法

我只安装了webpack,没有安装webpack-cli,第一次输入webpack打包时,提示 One CLI for webpack must be installed. These are recommended choices, delivered as separate packages: - webpack-cli (https://github.com/webpack/webpack-cli) The original webpack full-featured CLI. We wi

Nodejs npm安装socket.io报错解决办法

安装socket.io时,报错,提示需要安装Microsoft visual studio 2005 或 Net framework 2.0 sdk,没有找到vcbuild.exe,解决办法是安装 .NET Framework 2.0 Software Development Kit (SDK) http://www.microsoft.com/en-us/download/details.aspx?id=15354 并将 C:\Program Files\Microsoft Visual St

解决node在ubuntu下npm install canvas不断报错的尴尬

项目中需要用到node中一个验证码的npm包:captchagen,此npm包依赖canvas画布npm包.执行npm install canvas时就会报错,错误代码显示文件编译失败.最终在github问答上找到答案: 问题根源是ubuntu中缺少图形开发库,一一安装上问题解决. sudo apt-get install libcario-dev; sudo apt-get install libjpeg-dev; sudo apt-get install libgif-dev; sudo a

Vue 项目: npm run dev b报错 “&#39;webpack-dev-server&#39; 不是内部或外部命令,也不是可运行的程序 或批处理文件。”

前提: 电脑已经安装了nodeJS和npm,  项目是直接下载的zip包. 报错步骤为1:cd /d 目录: 2. npm ren dev  -------> 报错如下: > webpack-dev-server --inline --progress --config build/webpack.dev.conf.js 'webpack-dev-server' 不是内部或外部命令,也不是可运行的程序或批处理文件.npm ERR! code ELIFECYCLEnpm ERR! errno 1

npm安装cnpm时候报错code EINTEGRITY

npm安装cnpm时候报错code EINTEGRITY错误展示 PS C:\Users\by\Desktop\element_ui_demo> npm install --g  npmnpm ERR! code EINTEGRITYnpm ERR! sha512-DowXzQwtSWDtbAjuWecuEiismR0VdNEYaL3VxNTYTdW6AGkYxfGk9LUZ/rt6etEyiH4IEk95HkJeGfXE5Rz9xQ== integrity checksum failed wh

npm install vue-cli -g 报错

npm 安装vue脚手架报错 报错详情 npm ERR! Unexpected end of JSON input while parsing near '...TuHxXJaknDulF3AdSBoul' npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\xxx\AppData\Roaming\npm-cache\_logs\2019-12-22T03_12_06_342Z-debug.log 最后解决

vue项目更换目录后执行npm run dev 就报错(新手进)

在我们搭建好一个VUE项目的环境后,觉得这个项目存放的位置不好,想移动一下,但是移动后我们发现执行npm run dev就会报下面的错误: 明明只是移动了一下位置,就报错,实在是太恶心了. 但是只要我们细心看一下错误:,然后去node_modules文件夹下去找这个包,会发现这个包是这样的 我们发现:这只是一个快捷方式,根本就不是我们下载的module 如果只有一个是这样,我们直接使用npm install semver就OK了,但是很遗憾,这样的东西不是一个而是几百个: 无语...总不能一个个

Django学习(1)——python manage.py startapp app-name新建app报错问题

作为一个刚接触python的小白,开始学习Django注定前路漫漫,记录一下学习过程中的问题和解决方案. 感谢“自强学堂”的无私奉献,根据教程安装了Django 1.9.12后,尝试新建项目,此时使用python manage.py startapp app-name 一直无法建立app.错误的最后一行是“django.core.exceptions.ImproperlyConfigured: Error loading either pysqlite2 or sqlite3 modules (

Vue 项目在其他电脑 npm run dev 运行报错的解决方法

一个 Vue 项目从一台电脑上传到 github 上之后,再另外一台电脑上 git clone .并使用 npm run dev 或 npm run start 发生以下报错的解决方法. 报错原因 缺少 node_modules 里面的依赖.在项目目录下使用 npm install然后再 npm run dev.如果在这一步当中, npm install 执行的过程中,处于一直卡顿的状态.说明网络状况不佳.建议使用 cnpm 淘宝源. 淘宝源 使用 cnpm -v 查看是否已经安装 cnpm.如