尝试使用以下命令从电子构建Windows包
angular 2
它给了我以下错误:
`命令失败:npm prune --production 错误的ERR!可能无法删除:C:\ Users \ jessica \ AppData \ Local \ Temp \ electron-packager \ win32-ia32 \ Tutorial-win32-ia32 \ resources \ app \ node_modules.bin
npm ERR!可以在以下位置找到此运行的完整日志: 错误的ERR! C:\用户\杰西卡\应用程序数据\漫游\ NPM-cache_logs \ 2017-08-11T06_51_09_755Z-debug.log`
我在5.3.0
npm版本是:{
"productName": "invoice",
"version": "0.1.0",
"main": "main.js",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/common": "^4.0.0",
"@angular/compiler": "^4.0.0",
"@angular/core": "^4.0.0",
"@angular/forms": "^4.0.0",
"@angular/http": "^4.0.0",
"@angular/platform-browser": "^4.0.0",
"@angular/platform-browser-dynamic": "^4.0.0",
"@angular/router": "^4.0.0",
"core-js": "^2.4.1",
"rxjs": "^5.1.0",
"zone.js": "^0.8.4"
},
"devDependencies": {
"@angular/cli": "1.0.2",
"@angular/compiler-cli": "^4.0.0",
"@types/jasmine": "2.5.38",
"@types/node": "~6.0.60",
"codelyzer": "~2.0.0",
"electron": "^1.7.5",
"jasmine-core": "~2.5.2",
"jasmine-spec-reporter": "~3.2.0",
"karma": "~1.4.1",
"karma-chrome-launcher": "~2.0.0",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^0.2.0",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.0",
"ts-node": "~2.0.0",
"tslint": "~4.5.0",
"electron-packager": "8.1.0",
"typescript": "~2.2.0"
}
}
我的package.json如下:
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style>
.col-md-6{
margin: 1px;
}
</style>
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-md-6"><img src="top-header-1.png"></div>
<div class="col-md-6"><img src="Base-BG_4.png"></div>
</div>
</div>
</body>
</html>
请求帮助我解决此错误
答案 0 :(得分:1)
正如此用户在此处所建议的那样:https://github.com/electron-userland/electron-packager/issues/686
你应该运行
npm update -g npm
然后您可以再次构建您的应用。它至少对我有用。
答案 1 :(得分:0)
在我看来,PATH配置不正确。 最简单的方法是使用&#34; cmd节点&#34;如果你在Windows上