电子命令失败:npm prune --production
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了电子命令失败:npm prune --production相关的知识,希望对你有一定的参考价值。
尝试使用以下命令从电子构建Windows包
electron-packager . --overwrite --asar=true --platform=win32 --arch=ia32 --icon=assets/icons/win/icon
.ico --prune=true --out=release-builds --version-string.CompanyName=CE --version-string.FileDescription=CE --version-string
.ProductName="Electron Tutorial App"
它给了我以下错误:
`命令失败:npm prune --production npm ERR!可能无法删除:C: Users jessica AppData Local Temp electron-packager win32-ia32 Tutorial-win32-ia32 resources app node_modules.bin
错误的ERR!可以在以下位置找到此运行的完整日志:npm ERR! C:用户杰西卡应用程序数据漫游 NPM-cache_logs 2017-08-11T06_51_09_755Z-debug.log`
我在angular 2
npm版本是:5.3.0
我的package.json如下:
{
"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"
}
}
请帮我解决这个错误
正如此用户在这里建议:https://github.com/electron-userland/electron-packager/issues/686
你应该跑
npm update -g npm
然后,您可以再次构建您的应用程序它至少对我有用。
在我看来,PATH配置不正确。最简单的方法是使用“cmd节点”,如果你在Windows上
以上是关于电子命令失败:npm prune --production的主要内容,如果未能解决你的问题,请参考以下文章