“npm install [package]"不更新package.json [英] "npm install [package]" doesn't update package.json

查看:128
本文介绍了“npm install [package]"不更新package.json的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用Laravel并尝试使用 angular-ui-sortable angular-utils-pagination

I've been using Laravel and trying to use angular-ui-sortable and angular-utils-pagination.

我用 npm 安装它们,但无法获得 package.json 更新为 angular-utils-pagination

I installed them with npm, but can't get package.json updated for angular-utils-pagination.

该文件现在看起来像......

The file now looks like...

 {
  "private": true,
  "devDependencies": {
   "gulp": "^3.8.8"
  },
  "dependencies": {
    "angular-ui-sortable": "^0.14.0",
    "bootstrap-sass": "^3.0.0",
    "laravel-elixir": "^4.0.0"
  }
}

重点是 angular-ui-sortable 但是 angular-utils-pagination 不是。这两个文件都在 node_module 文件夹下。据我了解,这些库必须在 package.json 中的依赖下才能使它们可用。

The point is that angular-ui-sortable is there but angular-utils-pagination is not. Both files are under node_module folder. As far as I understand, those libraries have to be under dependencies in package.json for them to be available.

任何建议都将受到赞赏。

Any advice will be appreciated.

推荐答案

添加 angular-utils-pagination 在依赖项下尝试:

npm install angular-utils-pagination --save

它现在应该出现在package.json文件中。

It should now appear in the package.json file.

作为参考,将依赖项添加到package.json:

For reference, adding dependencies to package.json:

npm install <package> --save

将dev依赖项添加到package.json:

Adding dev dependencies to package.json:

npm install <package> --save-dev

祝你好运!

这篇关于“npm install [package]&quot;不更新package.json的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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