I've been using Laravel and trying to use angular-ui-sortable and 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"
}
}
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.
The npm install installs all modules that are listed on package. json file and their dependencies. npm update updates all packages in the node_modules directory and their dependencies.
By default, npm install will install all modules listed as dependencies in package.json .
To add a angular-utils-pagination under dependencies try:
npm install angular-utils-pagination --save
It should now appear in the package.json file.
For reference, adding dependencies to package.json:
npm install <package> --save
Adding dev dependencies to package.json:
npm install <package> --save-dev
Good luck!
In order to save the package in the package.json file as a dependency you need to write
npm install <package-name> --save
if you want to save the package as a development package only (not to be installed on production server) write the following:
npm install <package-name> --save-dev
To install dependencies from the package.json file:
npm install *installs all dependencies*
npm install --production *will only install "dependencies"*
npm install --dev *will only install "devDependencies"*
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With