npm install不安装任何依赖项

[英]npm install doesn't install any dependencies


I am trying to install packages in the package.json file. Unfortunately, when I run npm install, nothing happens (nothing is installed). I have used npm install on other repos and it works successfully.

我正在尝试在package.json文件中安装软件包。不幸的是,当我运行npm install时,没有任何反应(没有安装)。我在其他repos上使用了npm install,它运行成功。

Here is my path:

这是我的路径:

$PATH = /Users/me/.rbenv/shims:/Users/me/.rbenv/bin:/usr/local/share/npm/bin:/usr/local/bin:/Applications/Postgres.app/Contents/MacOS/bin:/usr/bin:/bin:/usr/sbin:/sbin

As you can see, npm/bin is in my bath and I believe this is correct.

如你所见,npm / bin在我的浴室里,我相信这是正确的。

Here are the instructions for this repo and where to run npm install (which I am doing)

以下是此repo的说明以及运行npm install的位置(我正在做)

go into "module"
run "npm install"
pair your laptop/pc with intelligent brick troubleshoot: http://www.ev-3.net/en/archives/97
run example.js: "node example.js"
see "example.js" for more details

When I run npm install in the module directory (that has the package.json) nothing installs.

当我在模块目录(具有package.json)中运行npm install时,没有安装任何东西。

Here is the package.json:

这是package.json:

{
  "name": "ev3-nodejs-bt",
  "description": "Bt Api for lego ev3 robot",
  "version": "0.0.4",
  "private": false,
  "dependencies": {
    "serialport": "1.*"
  },
  "main": "Ev3.js",
  "devDependencies": {"serialport": "1.*"},
  "scripts": {
    "test": "node Ev3.js"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/wenchaojiang/Ev3NodeJsBtAPI"
  },
  "keywords": [
    "node.js",
    "ev3",
    "lego",
    "robot",
    "bluetooth"
  ],
  "author": "Wenchao Jiang <psxwj@nottingham.ac.uk> (http://wenchaojames.wordpress.com/)",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/wenchaojiang/Ev3NodeJsBtAPI/issues"
  }
}

Do I have something set up wrong on my system? (I don't think I do based on my $PATH and successful installing packets in other node-js repos) Is this package.json file not valid?

我的系统上有什么设置错误吗? (我不认为我基于我的$ PATH并在其他node-js repos中成功安装数据包)这个package.json文件无效吗?

2 个解决方案

#1


8  

npm install doesn't install (or echo) anything when all of the dependencies are satisfied. Ensure there's a serialport folder under node_modules.

当满足所有依赖项时,npm install不会安装(或回显)任何内容。确保node_modules下有一个serialport文件夹。

If you want to reinstall everything, you just need to remove the node_modules folder:

如果要重新安装所有内容,只需删除node_modules文件夹:

rm -r node_modules
npm install

#2


1  

If you have an npm-shrinkwrap.json file, check it. The npm install command will only install the packages specified in that file.

如果你有一个npm-shrinkwrap.json文件,请检查它。 npm install命令仅安装该文件中指定的包。

According to the npm install docs:

根据npm安装文档:

If the package has a shrinkwrap file, the installation of dependencies will be driven by that.

如果包具有shrinkwrap文件,则依赖性的安装将由此驱动。

I had the same problem with my project. And when I looked at my npm-shrinkwrap.json file, I saw dependencies: {}. So that's why it didn't install anything for me.

我的项目遇到了同样的问题。当我查看我的npm-shrinkwrap.json文件时,我看到了依赖项:{}。所以这就是为什么它没有为我安装任何东西。


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.itdaan.com/blog/2014/04/25/d1a80f59719e805bf0dc774e09bbd1cf.html



 
© 2014-2018 ITdaan.com 粤ICP备14056181号