npm run build给出npm ERR!代码ELIFECYCLE

F9lke

我对Node.js和Electron非常陌生,想运行npm run build不幸的是,这只给了我错误代码ELIFECYCLE。

这是我的package.json

{
    "name": "firstelectronproject",
    "version": "0.1.0",
    "description": "My first Electron project",
    "main": "main.js",
    "scripts": {
        "start": "electron index.js",
        "package": "",
        "build": "electron-packager . FEP"
    },
    "author": "F9lke <florian.thomasgoetzrath.de>",
    "license": "MIT",
    "dependencies": {
        "electron": "^1.6.11"
    },
    "devDependencies": {
        "asar": "^0.13.0",
        "electron-packager": "^8.7.2"
    }
}

这是我的命令提示符的日志:

 D:\Eigene Dateien\Desktop\Coding\Desktop Apps\FEP>npm run build

> [email protected] build D:\Eigene Dateien\Desktop\Coding\Desktop Apps\FEP
> electron-packager . FEP

Packaging app for platform win32 x64 using electron v1.6.11
Command failed: npm prune --production
npm WARN invalid config loglevel="notice"
npm WARN [email protected] No repository field.

npm ERR! May not delete: C:\Users\User\AppData\Local\Temp\electron-packager\win32-x64\FEP-win32-x64\resources\app\node_modules\.bin

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\User\AppData\Roaming\npm-cache\_logs\2017-07-21T11_38_37_230Z-debug.log

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `electron-packager . FEP`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\User\AppData\Roaming\npm-cache\_logs\2017-07-21T11_38_37_293Z-debug.log  

这是日志输出:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'build' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle [email protected]~prebuild: [email protected]
6 info lifecycle [email protected]~build: [email protected]
7 verbose lifecycle [email protected]~build: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~build: PATH: C:\Users\User\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin;D:\Eigene Dateien\Desktop\Coding\Desktop Apps\FEP\node_modules\.bin;C:\Program Files (x86)\Razer Chroma SDK\bin;C:\Program Files\Razer Chroma SDK\bin;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Brackets\command;C:\Program Files\nodejs\;C:\Users\User\AppData\Local\Microsoft\WindowsApps;C:\Users\User\AppData\Local\atom\bin;C:\Users\User\AppData\Roaming\npm
9 verbose lifecycle [email protected]~build: CWD: D:\Eigene Dateien\Desktop\Coding\Desktop Apps\FEP
10 silly lifecycle [email protected]~build: Args: [ '/d /s /c', 'electron-packager . FEP' ]
11 silly lifecycle [email protected]~build: Returned: code: 1  signal: null
12 info lifecycle [email protected]~build: Failed to exec build script
13 verbose stack Error: [email protected] build: `electron-packager . FEP`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Users\User\AppData\Roaming\npm\node_modules\npm\lib\utils\lifecycle.js:289:16)
13 verbose stack     at emitTwo (events.js:106:13)
13 verbose stack     at EventEmitter.emit (events.js:191:7)
13 verbose stack     at ChildProcess.<anonymous> (C:\Users\User\AppData\Roaming\npm\node_modules\npm\lib\utils\spawn.js:40:14)
13 verbose stack     at emitTwo (events.js:106:13)
13 verbose stack     at ChildProcess.emit (events.js:191:7)
13 verbose stack     at maybeClose (internal/child_process.js:891:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
14 verbose pkgid [email protected]
15 verbose cwd D:\Eigene Dateien\Desktop\Coding\Desktop Apps\FEP
16 verbose Windows_NT 10.0.15063
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
18 verbose node v6.11.1
19 verbose npm  v5.3.0
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] build: `electron-packager . FEP`
22 error Exit status 1
23 error Failed at the [email protected] build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
萨德·艾哈迈德(Saad Ahmad)

我通过安装阵列解决了这个问题unique,它开始工作:

npm install --save array-unique

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

运行“ npm run build”后收到npm错误:npm ERR!代码ELIFECYCLE npm ERR!错误2

什么是npm ERR!代码ELIFECYCLE?

npm ERR!代码ELIFECYCLE(开始发行)

调试npm ERR!代码ELIFECYCLE npm ERR!errno 1

尝试并发运行(npm ERR!代码 ELIFECYCLE npm ERR!)

npm run build 抛出错误代码 ELIFECYCLE

npm ERR!运行npm install时的代码ELIFECYCLE

npm ERR!代码ELIFECYCLE npm后安装脚本

如何解决npm错误“ npm ERR!代码ELIFECYCLE”

如何解决节点服务器错误,npm ERR!代码ELIFECYCLE npm ERR!errno 1?

我该如何解决'npm ERR!npm启动期间Project.js中的代码ELIFECYCLE'

我启动npm时遇到了这个问题:npm ERR!代码ELIFECYCLE

如何解决错误:迁移MD5校验和失败[1] npm ERR!代码ELIFECYCLE npm ERR!errno 1

npm ERR!天蓝色devops中的代码ELIFECYCLE无法使其运行

npm ERR!代码ELIFECYCLE-无法启动开发服务器

npm install会给出“ npm ERR!代码ENOTFOUND'错误

Npm ERR!代码EPERM

`npm install npm`给出gyp ERR和npm ERR

运行“npm run build”时出现 npm run build 错误

在`npm run build`时出错

如何运行`npm run build`

npm安装不起作用| npm ERR!路径 npm ERR!代码 npm ERR!errno | npm ERR!syscall | npm ERR!天生的

如何解决 Linux 中的“npm ERR!code ELIFECYCLE”错误?

Laravel:CentOS 上的 npm 退出代码 1 代码 ELIFECYCLE

“ npm r build”和“ npm run build”的区别?

呃!运行npm start时输入代码ELIFECYCLE

npm 错误!代码 ELIFECYCLE,errno ENOENT & syscall spawn

npm install和npm run build有什么区别?

“ npm run build” =“反应脚本:权限被拒绝”