简体   繁体   English

npm 错误! 安装电子打包器

[英]npm ERR! install electron-packager

I am creating a new electron app and now I need to install electron-packager in it.我正在创建一个新的电子应用程序,现在我需要在其中安装电子打包器。

node -v v10.16.0 & npm -v v6.9.0 node -v v10.16.0 & npm -v v6.9.0

(I updated both) (我更新了两个)

I have tried to run this:我试图运行这个:

npm install electron-packager --save-dev

and this:和这个:

npm install electron-packager -g

The Error:错误:

npm ERR! code E404
npm ERR! 404 Not Found - GET http://registry.npmjs.org/electron-packager
npm ERR! 404
npm ERR! 404  'electron-packager@latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

What can I do?我能做什么?

Thanks!谢谢!

It would be better if you specified the OS.如果您指定操作系统会更好。 I once faced this problem and downgrading node to v8.0 fixed this problem.我曾经遇到过这个问题,将 node 降级到 v8.0 解决了这个问题。

But I would strongly recommend you to use electron-builder( https://github.com/electron-userland/electron-builder ) instead of electron-packager for creating installer packages, as it is a lot easier with lot more options including built-in auto-update feature.但我强烈建议您使用电子构建器( https://github.com/electron-userland/electron-builder )而不是电子打包器来创建安装程序包,因为它更容易有更多选项,包括构建-in 自动更新功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM