I am trying host a ReactJS application on a virtualhost on CentOS 7 server. After cloning the project on the server, I tried to build the project. But after running "sudo npm install", i got following error:
npm ERR! Linux 3.10.0
npm ERR! argv "/usr/local/n/versions/node/16.13.1/bin/node" "/bin/npm" "install"
npm ERR! node v16.13.1
npm ERR! npm v3.10.10
npm ERR! cb.apply is not a function
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https:
npm ERR! Please include the following file with any support request:
npm ERR! /home/my-repo/npm-debug.log
"npm-debug.log" file has following:
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli '/usr/local/n/versions/node/16.13.1/bin/node',
1 verbose cli '/bin/npm',
1 verbose cli 'install'
1 verbose cli ]
2 info using npm@3.10.10
3 info using node@v16.13.1
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 verbose stack TypeError: cb.apply is not a function
7 verbose stack at /usr/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:267:18
7 verbose stack at FSReqCallback.oncomplete (node:fs:199:5)
8 verbose cwd /home/my-repo
9 error Linux 3.10.0
10 error argv "/usr/local/n/versions/node/16.13.1/bin/node" "/bin/npm" "install"
11 error node v16.13.1
12 error npm v3.10.10
13 error cb.apply is not a function
14 error If you need help, you may report this error at:
14 error <https:
15 verbose exit [ 1, true ]
What I have tried:
I tried to upgrade npm version using "sudo npm install -g npm@latest" .
And i also tried to update "graceful-fs". But they always show same following error:
npm ERR! Linux 3.10.0
npm ERR! argv "/usr/local/n/versions/node/16.13.1/bin/node" "/bin/npm" "install" "-g" "npm@latest"
npm ERR! node v16.13.1
npm ERR! npm v3.10.10
npm ERR! cb.apply is not a function
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https:
npm ERR! Please include the following file with any support request:
npm ERR! /home/my-repo/npm-debug.log
"sudo npm cache verify" shows following:
npm ERR! Usage: npm cache add <tarball file>
npm ERR! npm cache add <folder>
npm ERR! npm cache add <tarball url>
npm ERR! npm cache add <git url>
npm ERR! npm cache add <name>@<version>
npm ERR! npm cache ls [<path>]
npm ERR! npm cache clean [<pkg>[@<version>]]
Can anyone tell me how to fix the problem ?