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/

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:
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:


  "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": ""
  "keywords": [
  "author": "Wenchao Jiang <> (",
  "license": "MIT",
  "bugs": {
    "url": ""

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 个解决方案



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:


rm -r node_modules
npm install



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:


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


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.




© 2014-2018 粤ICP备14056181号