VUE project taken from elsewhere, npm run serve reports error

Problem symptoms:

The VUE project copied from elsewhere, the project dependencies were loaded through npm install according to the instructions, but an error was reported when running npm run serve: 

npm ERR! Missing script: "serve"

npm ERR!

npm ERR! To see a list of scripts, run:

npm ERR!   npm run

Problem solving ideas:

package.json The file is a list of items. It can do a lot of completely unrelated things. For example, it is a configuration center for tools. It is also where npm and yarn store the names and versions of all installed packages. In package.json:

  • version Indicates the current version.
  • name Sets the name of the application/package.
  • description is a short description of the application/package.
  • main Sets the entry point for the application.
  • private If set to true, this prevents applications/packages from being accidentally published to npm.
  • scripts Defines a set of node scripts that can be run.
  • dependencies sets the list of npm packages that are installed as dependencies.
  • devDependencies sets the list of npm packages that are installed as development dependencies.
  • engines Sets which version of Node.js this package/application runs on.
  • browserslist Used to tell which browsers (and their versions) to support.

All of the above properties can be used by npm or other tools.

When an error is reported during this run, the executable script information specified in package.json is as follows:

The commands you need to use at this time should be: npm run dev, npm run build or npm run lint;

The running results are as follows:

おすすめ

転載: blog.csdn.net/yeyuningzi/article/details/134013977