简体   繁体   中英

I get multiple errors, when I try to install all modules from a package.json file on my nginx webserver

I'm currently trying to configure my portfolio on a VPS using nginx and Putty. Now I want to install all required modules for my backend, but I get this errors. I have no idea what to do and would love to get some help.

npm ERR! Linux 4.15.0
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2
npm ERR! path /root/portfolio/server/node_modules/.staging/@types/webidl-conversions-b037bbf1/package.json
npm ERR! code ENOTDIR
npm ERR! errno -20
npm ERR! syscall open 
npm ERR! ENOTDIR: not a directory, open '/root/portfolio/server/node_modules/.staging/@types/webidl-conversions-b037bbf1/package.json'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR!     /root/portfolio/server/npm-debug.log

To install all the modules, I went to my backend folder and typed 'npm install' in my Putty console. Then it starts to download the modules and everything seems fine, until the errors pop up after a few seconds. I also tried 'apt-get update' and 'apt-get upgrade', but it changes nothing.

I found the solution to my problem. I had to update my node and npm, but not like usually with 'apt update', 'apt upgrade', 'apt install nodejs' or 'apt install npm'. Instead I tried this:

curl -o-https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash nvm install 14.4.0

... and then it worked. Hope this will help someone

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM