• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Please beaware of a breaking change in the REST API on the next Plesk release (18.0.62).
    Starting from Plesk Obsidian 18.0.62, requests to REST API containing the Content-Type header with a media-type directive other than “application/json” will result in the HTTP “415 Unsupported Media Type” client error response code. Read more here

Question 'npm install' does not work on a nodejs project in a plesk

Brenda6568

New Pleskian
Server operating system version
window
Plesk version and microupdate number
Plesk Onyx
I'm trying to deploy my nodejs project on my plesk server but something went wrong.

Even if everything works fine on localhost, I can not install npm on the plesk and I don't know why.

Here is my package.json :

{
"name": "node-mysql-boilerplate",
"version": "1.0.7",
"description": "node-mysql-boilerplate",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node app.js"
},
"dependencies": {
"@cosmjs/encoding": "^0.28.11",
"@elrondnetwork/elrond-core-js": "^2.1.0",
"@elrondnetwork/erdjs": "^10.2.5",
"@elrondnetwork/erdjs-network-providers": "^0.1.5",
"@elrondnetwork/erdjs-walletcore": "^1.0.0",
"ajv": "^5.5.2",
"artillery": "^2.0.0-16",
"axios": "^0.27.2",
"bcrypt": "^3.0.8",
"bcryptjs": "*",
"bech32-converting": "^1.0.9",
"body-parser": "*",
"cors": "*",
"express": "^4.18.1",
"flatted": "^3.2.6",
"fs": "^0.0.1-security",
"ipfs-api": "^26.1.2",
"ipfs-http-client": "^57.0.3",
"jsonwebtoken": "^8.5.1",
"mysql": "^2.18.1",
"node-schedule": "^1.3.0",
"nodemailer": "^6.7.5",
"nodemon": "^1.19.4",
"pm2": "^2.10.4",
"react": "^18.1.0",
"to-hex": "^0.0.18"
},
"author": "",
"license": "ISC"
}

Here is the error message on npm install process :

npm ERR! code 127
npm ERR! path /var/www/vhosts/apcom.app/elrond-api.apcom.app/node_modules/peer-id/node_modules/ursa-optional
npm ERR! command failed
npm ERR! command sh -c node rebuild.js
npm ERR! sh: 1: node: Permission denied

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-07-28T14_46_54_171Z-debug.log

My node version and npm version in the plesk

node -v # v16.13.0
npm -v # 8.1.0

Here is the link to the boilerplate I use for this nodejs project : GitHub - yug95/node-mysql: Node with mysql boilerplateaccontant

I have tried this, but nothing changes :
npm config set user 0
npm config set unsafe-perm true

and

rm -rf node_modules # Delete node_modules folder
npm install # Retry to install
 
Back
Top