如果项目有错,比如一些语法错误,跑npm start会报错,但是npm run lite是可以直接过,并打开浏览器,为什么呢? “npm start命令,但实际运行的是npm run lite命令”,是不是说明npm start和npm run lite一样的呢? “npm run lite是单独跑服务,编译不了js”,所以才会忽略错误,在浏览器显示了吗?
First of all, let me tell you, this is documented Secondly, their names are different, of course they have different meanings. Run something, start? Of course it is the beginning, so be more special and read the documentation for details. BTW Real-name objection to the above of
npm start==npm run start
if the package's "scripts" object doesn't have "start" command, it would throw an error
Open
package.json
,对比一下scripts
下面start
和lite
and you will know the difference between the two.First of all, let me tell you, this is documented
Secondly, their names are different, of course they have different meanings. Run something, start? Of course it is the beginning, so be more special and read the documentation for details.
BTW Real-name objection to the above of
if the package's "scripts" object doesn't have "start" command, it would throw an error