无法 npm 安装我的包 [英] Unable to npm install my package

查看:59
本文介绍了无法 npm 安装我的包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试安装一个我为其定义了 package.json 的包.package.json 文件非常简单.

I've been trying to install a package that I have defined the package.json for. The package.json file is very simple.

{
  "name": "project",
  "version": "0.0.1",
  "devDependencies": {
    "karma-jasmine": "0.2.2"
  }
}

现在当我发出一个

npm install .

我收到以下错误.

npm WARN package.json package.json@0.0.0 No repository field.
npm ERR! addLocal Could not install /Users/username/projects/project
npm ERR! Darwin 14.0.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "."
npm ERR! node v0.10.32
npm ERR! npm  v2.1.5
npm ERR! code EISDIR
npm ERR! errno 28

npm ERR! EISDIR, read
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/username/projects/project/npm-debug.log

无法理解我做错了什么.

Unable to understand what am I doing wrong.

推荐答案

在这上面花了很多时间后,我终于找到了原因.我没有 package.json 文件,但我有它拼写错误 作为 packages.json 文件.

After spending a lot of time on this I finally figured out the cause. I didn't have a package.json file but I had it misspelt as packages.json file.

NPM 无法从当前目录中提取文件,然后它尝试了我的主目录,然后显示了无用的错误.我希望这能帮助某人节省一些时间.

NPM wasn't able to pick up the file from the current directory and then it tried my home directory and then showed the unhelpful error. I hope this will help somebody save some time.

这篇关于无法 npm 安装我的包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆