Node.js on Plesk

How to solve the problem with NPM Install?
Node.js Version 12.4.0
This is a tutorial for it:

Everything works except installing NPM.
Problem with the unsupported format:
/app/package.json: Unsupported file format

npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2

Btw. Can`t use Docker desktop because of hardware limitation.

NPM install

  • npm WARN pg@8.6.0 requires a peer of pg-native@>=2.0.0 but none is installed. You must install peer dependencies yourself.
  • npm WARN ws@7.4.6 requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself.
  • npm WARN ws@7.4.6 requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencies yourself.
  • npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents):
  • npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})

Expected behavior - the automatic installation of the peer dependencies [was removed in npm 3]

Note: If the file package.json is a part of a third-party application, please contact the application developers so they fix the content of package.json.

So you solved your first problem? Probably chosen a newer NodeJS version to use in Plesk?

The warnings you see during NPM install - are just warnings of optional modules that you don’t have and don’t need. So you can ignore them.

Actually, everything works. I just worried that missing modules can reflect in some functions later. I tried with a new version of Node 14.17.3 which is not jet implemented in Plesk, so manually installed, but then is a different problem when trying NPM install:
/usr/bin/env: ‘node’: No such file or directory
so I returmed to 12.4.0