After the front-end project is deployed, execute the startup command to report an error, and make a record for reference when encountering the same problem:
Forever installation command: npm install -g forever
This error is caused by the low version of node. You can go to the official website to download the latest version ( https://nodejs.org/zh-cn/download/current/), or upgrade the version of node.
node upgrade
Node has a module called n, which is specifically used to manage the version of node.js.
- The first step: first install the n module:
npm install -g n
- Step 2: Upgrade node.js to the latest stable version
n stable
The second step is also possible
- Step 2: n can also be followed by the version number, such as:
n v0.10.26
n 0.10.26
In addition, share a few common commands of
npm npm -v #Display version, check whether npm is installed correctly.
npm install express #install express module
npm install -g express #install express module globally
npm list #List installed modules
npm show express #Display module details
npm update #Upgrade all modules of the project in the current directory
npm update express #Upgrade the specified module of the project in the current directory
npm update -g express #Upgrade the express module installed globally
npm uninstall express #Delete the specified module