Skip to content

Commit

Permalink
More removal of npm
Browse files Browse the repository at this point in the history
This commit just follows on from #662. Now it's not required it can also be removed from system info and various other installs e.g. in docker
  • Loading branch information
sbs20 committed Oct 25, 2023
1 parent 8f09345 commit 10f7370
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 33 deletions.
3 changes: 0 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ This may be useful
# Node version
echo "node: $(node -v)"

# NPM version
echo "npm: $(npm -v)"

# Docker version
echo "docker: $(docker -v)"

Expand Down
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ FROM debian:bookworm-slim AS scanservjs-base
RUN apt-get update \
&& apt-get install -yq \
nodejs \
npm \
adduser \
imagemagick \
ipp-usb \
Expand Down
19 changes: 0 additions & 19 deletions app-server/src/classes/system.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const os = require('os');
const Process = require('./process');
const FileInfo = require('./file-info');

const ContainerTypes = {
Expand All @@ -9,18 +8,6 @@ const ContainerTypes = {
SYSTEMD_NSPAWN: 'systemd-nspawn'
};

/**
* @returns {Promise<string>} The detected npm version
*/
async function getNpmVersion() {
try {
const buffer = await Process.spawn('npm -v');
return buffer.toString().trim();
} catch (error) {
return 'Failed to determine';
}
}

/**
* @returns {'docker' | 'podman' | 'systemd-nspawn' | null>} The used container technology, or null if no container was detected.
*/
Expand All @@ -44,7 +31,6 @@ function getContainerType() {
module.exports = new class System {

constructor() {
this.npmVersion = null;
this.containerType = null;
}

Expand All @@ -56,10 +42,6 @@ module.exports = new class System {
this.containerType = getContainerType();
}

if (this.npmVersion === null) {
this.npmVersion = await getNpmVersion();
}

const info = {
os: {
arch: os.arch(),
Expand All @@ -69,7 +51,6 @@ module.exports = new class System {
type: os.type()
},
node: process.version,
npm: this.npmVersion,
containerType: this.containerType,
};

Expand Down
3 changes: 0 additions & 3 deletions app-server/src/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -489,9 +489,6 @@ definitions:
node:
type: string
example: "v12.22.12"
npm:
type: string
example: "8.3.0"
docker:
type: boolean

Expand Down
1 change: 0 additions & 1 deletion app-server/src/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@
* @typedef {Object} SystemInfo
* @property {OsInfo} os
* @property {string} node
* @property {string} npm
* @property {boolean} docker
*/

Expand Down
6 changes: 0 additions & 6 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,6 @@ npm run lint && npm run test && npm run build
npm run util:missing-translations
```

## Updating node dependencies

* `npm audit fix` or `npm update`. This won't remove old packages; to do so,
delete node_modules and reinstall
* `cd packages/client/ && npx browserslist@latest --update-db`

## References

* [i18n](https://www.codeandweb.com/babeledit/tutorials/how-to-translate-your-vue-app-with-vue-i18n)
Expand Down

0 comments on commit 10f7370

Please sign in to comment.