【问题标题】:I've this problem when I start npm: npm ERR! code ELIFECYCLE我在启动 npm 时遇到了这个问题:npm ERR!代码生命周期
【发布时间】:2020-09-09 10:00:59
【问题描述】:

当我执行 npm start 时,它给了我这个错误(它是意大利语,但你可以使用谷歌翻译):

npm start

> codeeditor@1.0.0 start D:\CodeEditor
> electron .

"electron" non ▒ riconosciuto come comando interno o esterno,
 un programma eseguibile o un file batch.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! codeeditor@1.0.0 start: `electron .`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the codeeditor@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Giovanni\AppData\Roaming\npm-cache\_logs\2020-05-22T14_13_45_030Z-debug.log

谢谢你的帮助;)

【问题讨论】:

  • 一个更详细的问题将不胜感激,关于你尝试了什么,你开始了什么。
  • 看起来electron 不可用。有没有试过全局安装npm install -g electron??

标签: node.js npm electron


【解决方案1】:

首先使用npm init初始化package.json。然后使用npm i electron安装电子。那就试试npm start

【讨论】:

  • 谢谢,它成功了,抱歉这是我第一次使用它
  • 另外,当你从 github 等下载任何东西时,请确保在启动应用程序之前使用 npm i 安装所有依赖项。(可以在 package.json 中看到
【解决方案2】:

最简单的答案, 先安装electron,再运行。

npm install electron

还要确保你没有使用 gitbash 来运行 npm run。

【讨论】:

    猜你喜欢
    • 2020-12-23
    • 2019-09-13
    • 2017-12-27
    • 1970-01-01
    • 2021-07-10
    • 2018-09-03
    • 2021-09-15
    • 1970-01-01
    • 2020-06-25
    相关资源
    最近更新 更多