> pet-shop@1.0.0 dev /home/lihanyu/vote/pet-shop-box
> lite-server
sh: 1: lite-server: not found
npm ERR! Linux 4.15.0-46-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "dev"
npm ERR! node v6.16.0
npm ERR! npm v3.10.10
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! pet-shop@1.0.0 dev: `lite-server`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the pet-shop@1.0.0 dev script 'lite-server'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the pet-shop package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! lite-server
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs pet-shop
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls pet-shop
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! Please include the following file with any support request:
npm ERR! /home/lihanyu/vote/pet-shop-box/npm-debug.log
下面部分摘自:https://stackoverflow.com/questions/42308879/npm-err-code-elifecycle 可去该问题下看更多人详细的介绍,我只摘取了认可度最高的那个答案。
Step 1: $ npm cache clean --force
Step 2: delete node_modules by $ rm -rf node_modules
folder or delete it manually by going into the directory and right-click > delete.(一定注意,这个node_modules是项目文件里的那个,而不是nodejs下的那个,删错了可就凉凉了,重新配环境,如果你没有在项目文件里找到node_modules,那说明你之前压根就没有执行过npm install,那问题就简单了,可以直接下一步)
Step 3: npm install
To start again, $ npm start
This worked for me. Hopes it works for you too.
PS: Still if it is there, kindly check the error it displays in red and act accordingly. This error is specific to node.js environment. Happy Coding!!