当我尝试编写时,收到了响应:
$ /opt/cpanel/ea-nodejs16/bin/npm -v
8.1.2
但是有:
$ npm -v
bash: npm: command not found
所以,我尝试使用相同的逻辑,但它没有起作用:
$ /opt/cpanel/ea-nodejs16/bin/npm install
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /home/mydomain/public_html/app/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/home/mydomain/public_html/app/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /home/mydomain/.npm/_logs/2022-03-02T14_43_55_155Z-debug.log
因此,如何在服务器上使“npm”命令行工作。
package.json
文件。 - jordanm