node_modules are only used locally. Some modules will install different modules according to the system version and nodejs version, so what you have to do is to move the node_modules folder out of the project directory, and then upload the project directory (in order to improve the upload speed, upload it anyway Delete it even if you go up), and then npm install again on the server
npm uses package.json this file to declare project dependencies.
1. Assume that the project already has package.jsonthis file
Then, when installing simditor, you can add --save to automatically add simditor to the package.json file
npm install simditor --save
Then, you will find that the package.json field content of dependencies has an additional dependency. When you get to the official server, run npm install in the project path and the relevant dependencies will be downloaded.
2. Assuming that the package.json file does not exist yet, then run the following command to create one. After creation, refer to the previous steps
npm init -f
Note: Do not include node_modules in version control unless necessary.
node_modules are only used locally. Some modules will install different modules according to the system version and nodejs version, so what you have to do is to move the node_modules folder out of the project directory, and then upload the project directory (in order to improve the upload speed, upload it anyway Delete it even if you go up), and then npm install again on the server
npm uses
package.json
this file to declare project dependencies.1. Assume that the project already has
package.json
this fileThen, when installing
simditor
, you can add--save
to automatically addsimditor
to thepackage.json
fileThen, you will find that the
package.json
field content ofdependencies
has an additional dependency.When you get to the official server, run
npm install
in the project path and the relevant dependencies will be downloaded.2. Assuming that the
package.json
file does not exist yet, then run the following command to create one. After creation, refer to the previous stepsNote: Do not include
node_modules
in version control unless necessary.