Symptoms
Installing Node.js application dependencies in Plesk in Domains > example.com > Node.js > NPM install ends with one or few warnings like the below one:
npm WARN [email protected] requires a peer of ajv@^5.0.0 but none is installed. You must install peer dependencies yourself.
Cause
Expected behavior - the automatic installation of the peer dependencies was removed in npm 3.
Resolution
Use one of the solutions:
Solution 1
-
Connect to the server using SSH under the subscription's system user.
-
Manually install the required peer dependencies:
# npm install --save-dev ajv
- Replace
npm
with/opt/plesk/node/XX/bin/npm
, whereXX
is the Node.js version. - Replace
ajv
with the name of the dependency from the warning message.
- Replace
Solution 2
-
Add all required peer dependencies into your application's file package.json in Domains > example.com > File Manager.
-
Click NPM install in Domains > example.com > Node.js once again.
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.