Node.js &引用;语法错误“;在使用npm安装sharp时,请安装

Node.js &引用;语法错误“;在使用npm安装sharp时,请安装,node.js,npm,centos,Node.js,Npm,Centos,您好,我在运行某些软件包时遇到了很多问题: sudo npm install -g 下面就是其中之一,我们非常感谢您的帮助。Tnx提前: > sharp@0.24.1 install /home/centos/Projects/smarttools/smarttools-strapi-backend/app/node_modules/sharp > (node install/libvips && node install/dll-copy && p

您好,我在运行某些软件包时遇到了很多问题:

sudo npm install -g
下面就是其中之一,我们非常感谢您的帮助。Tnx提前:

> sharp@0.24.1 install /home/centos/Projects/smarttools/smarttools-strapi-backend/app/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

/home/centos/Projects/smarttools/smarttools-strapi-backend/app/node_modules/tar/node_modules/mkdirp/lib/opts-arg.js:7
    opts = { mode: 0o777, fs, ...opts }
                              ^^^

SyntaxError: Unexpected token ...
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:549:28)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/centos/Projects/smarttools/smarttools-strapi-backend/app/node_modules/tar/node_modules/mkdirp/index.js:1:79)
gyp ERR! clean error
gyp ERR! stack Error: EACCES: permission denied, rmdir 'build'
gyp ERR! stack     at Error (native)
gyp ERR! System Linux 3.10.0-862.3.2.el7.x86_64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/centos/Projects/smarttools/smarttools-strapi-backend/app/node_modules/sharp
gyp ERR! node -v v6.17.1
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok

npm ERR! Linux 3.10.0-862.3.2.el7.x86_64
npm ERR! argv "/usr/bin/node" "/bin/npm" "rebuild"
npm ERR! node v6.17.1
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! sharp@0.24.1 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sharp@0.24.1 install script '(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the sharp package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs sharp
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls sharp
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/centos/Projects/smarttools/smarttools-strapi-backend/app/npm-debug.log
但我的节点版本是:

[centos@merng node_modules]$ node --version
v15.2.1
[centos@merng node_modules]$ npm --version
7.0.8
所以。。。怎么了? 我还使用nvm来更改npm和节点版本

[centos@merng node_modules]$ node --version
v15.2.1
[centos@merng node_modules]$ npm --version
7.0.8