【问题标题】:npm: Tried to reinstall admob-free plugin but it throws an error about not containing a package.json filenpm:试图重新安装无 admob 插件,但它抛出一个关于不包含 package.json 文件的错误
【发布时间】:2019-06-13 17:24:01
【问题描述】:

我正在使用 Ionic 制作应用,但由于某种原因 AdMob 插件未正确安装,因此我尝试重新安装它。但是,我不断收到错误消息。我检查了几个线程以获得一些帮助,并最终遵循了这些线程的建议。我删除了我的 package-locked.json 文件和我的 node_modules 文件夹,然后我尝试运行 npm i 并收到以下错误。任何想法如何解决这个问题?

Failed to fetch plugin file:node_modules/cordova-plugin-admob-free via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: npm: Command failed with exit code 1 Error output:
npm ERR! code ENOLOCAL
npm ERR! Could not install from "node_modules/cordova-plugin-admob-free" as it does not contain a package.json file.
npm ERR! A complete log of this run can be found in:
npm ERR!     /home/tatsuo/.npm/_logs/2019-06-13T05_12_13_705Z-debug.log

【问题讨论】:

  • 您需要一个 pacakage.json 文件丢失..检查您的项目文件是否可用
  • 如果你运行 npm update package-lock.json 得到更新并安装新的依赖项。
  • 我的项目目录中有一个 package.json 文件。我尝试运行 npm update package-lock.json 然后尝试 npm install,但我仍然得到同样的错误。

标签: angular ionic-framework npm


【解决方案1】:
npm init

原来的过时答案

我想你忘记设置 express 的目录了:

express <yourdirectory>

一旦你这样做了,你应该能够看到一堆文件,然后你应该运行命令:

npm install -d

【讨论】:

  • 什么是 express 命令?我的系统上没有该命令。
猜你喜欢
  • 1970-01-01
  • 2017-02-28
  • 2021-07-07
  • 2020-01-04
  • 1970-01-01
  • 1970-01-01
  • 2019-03-09
  • 2013-09-15
  • 1970-01-01
相关资源
最近更新 更多