Skip to content

Commit 2cfa810

Browse files
chore: replace 'npm install' with 'npm ci --omit=dev' for less update issues and improved performance
1 parent 061bdc0 commit 2cfa810

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Please note that this project is released with a [Contributor Code of Conduct](C
1313

1414
## Developer commands
1515

16+
- `npm install` - Install all dependencies.
1617
- `npm run download_modules` - Download module list manually.
1718
- `npm run lint` - Run linting and formatter checks.
1819
- `npm run lint:fix` - Fix linting and formatter issues.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ bash -c "$(curl -s https://raw.githubusercontent.com/Jopyth/MMM-Remote-Control/m
2929
- (1) Clone this repository in your `modules` folder, and install dependencies:
3030

3131
```bash
32-
cd ~/MagicMirror/modules # adapt directory if you are using a different one
32+
cd ~/MagicMirror/modules
3333
git clone https://github.com/Jopyth/MMM-Remote-Control
3434
cd MMM-Remote-Control
35-
npm install
35+
npm ci --omit=dev
3636
```
3737

3838
- (2) Add the module to your `config/config.js` file, if you add a `position`, it will display the URL to the remote on the mirror.
@@ -82,9 +82,9 @@ Note: If your user does not have `sudo` rights, the shutdown does not work (it _
8282
Update this module by navigating into its folder on the command line and using `git pull`:
8383
8484
```bash
85-
cd ~/MagicMirror/modules/MMM-Remote-Control # adapt directory if you are using a different one
85+
cd ~/MagicMirror/modules/MMM-Remote-Control
8686
git pull
87-
npm install # install (new) dependencies
87+
npm ci --omit=dev
8888
```
8989
9090
Alternatively you can run the `installer.sh` script again:

installer.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ if [ -d "$MM_HOME/modules/$MODULE_NAME" ] ; then
8989
echo ""
9090
echo "Checking for new dependencies to install..."
9191
echo ""
92-
npm install
92+
npm ci --omit=dev
9393
if [ $? -ne 0 ]; then
9494
echo "Failed to install new dependencies."
9595
exit 1;
@@ -131,7 +131,7 @@ else
131131
echo ""
132132
echo "Installing dependencies..."
133133
echo ""
134-
npm install
134+
npm ci --omit=dev
135135
if [ $? -ne 0 ]; then
136136
echo "Failed to install dependencies."
137137
exit 1;

node_helper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,7 @@ module.exports = NodeHelper.create({
940940
self.sendResponse(res, error);
941941
} else {
942942
const workDir = path.resolve(`${__dirname}/../${path.basename(url)}`);
943-
exec("npm install", {cwd: workDir, timeout: 120000}, (error, stdout, stderr) => {
943+
exec("npm ci --omit=dev", {cwd: workDir, timeout: 120000}, (error, stdout, stderr) => {
944944
if (error) {
945945
Log.error("[MMM-Remote-Control]", error);
946946
self.sendResponse(res, error, {stdout, stderr, ...data});
@@ -986,7 +986,7 @@ module.exports = NodeHelper.create({
986986
return;
987987
}
988988
if (result.summary.changes) {
989-
exec("npm install", {cwd: path, timeout: 120000}, (error, stdout, stderr) => {
989+
exec("npm ci --omit=dev", {cwd: path, timeout: 120000}, (error, stdout, stderr) => {
990990
if (error) {
991991
Log.error("[MMM-Remote-Control]", error);
992992
self.sendResponse(res, error, {stdout, stderr});

0 commit comments

Comments
 (0)