添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
正直的香瓜  ·  PVOutput Integration ...·  2 周前    · 
朝气蓬勃的柿子  ·  FastAPI with Django ...·  2 周前    · 
豪爽的枕头  ·  A10 Kernel startup ...·  5 天前    · 
千杯不醉的树叶  ·  main·  6 月前    · 
爱搭讪的蚂蚁  ·  QT笔记- ...·  7 月前    · 

Node.js allows developers to use JavaScript to create new command line tools. NPM is a package manager for Node.js. It's the default one. It consists of a command line client, and an online database of public and private packages, called the "npm registry", and is available here .

When you create an application developed on the Node.js platform, you can set up an error management system to take care of the problems encountered. The "ELIFECYCLE" error occurs when an unknown error causes the application to fail. Probably another software was running and conflicted with yours. When not, you have the possibility to redo a clean installation of your application.

The "ELIFECYCLE" error corresponds neither to a syntax error in the code nor to a permission problem because other sentences are then used to notify the error. This error reported that an unknown event caused the application to run normally. So you can check that another application is not using a resource that you need. This can be for example a port of the machine, or a component. You need to examine the log and see when the app has a problem.

1 - clear the npm cache The problem could also be with the installation of your application which encountered an unknown problem. To solve this, it is possible to start again on a healthy basis by reinstalling all the modules used by the application, and by emptying the NPM node package manager cache. The "npm cache clean" command clears the npm cache. Add the "--force" argument to force the operation.

npm cache clean --force
    Enter fullscreen mode
    Exit fullscreen mode

2 - delete node_modules just go to the root directory of your application and delete the "node_modules" folder. To remove the directory from the command line, the command depends on your operating system. The "rm" command is used with a Unix operating system. The arguments "r" and "f" indicate respectively to delete the subfolders and to force the deletion without asking for confirmation.

With Linux-based system:

rm -rf node_modules
    Enter fullscreen mode
    Exit fullscreen mode

3 - reinstall node_modules The "npm install" wil trigger a full download and installation of modules you need in your application. All you have to do then is to use the command "npm start" (check your package.json accordingly) to restart your application

With npm:

npm install
    Enter fullscreen mode
    Exit fullscreen mode

With Unix, you use the "rm" command to remove files. It's a too simple command; you just type rm followed by a list of files. The main problem is : "rm" is too simple. It's far too easy to remove more than you initially wanted, and once something is gone, it is gone forever. There are some hacks that make rm somehow more safe. To understand why it's impossible to reclaim deleted files, you need to know a bit about how the Unix filesystem works.

  • https://stackoverflow.com/a/49505612/2595513
  • https://docstore.mik.ua/orelly/unix3/upt/ch14_03.htm
  • https://www.journaldunet.fr/web-tech/developpement/1441095-comment-corriger-l-erreur-npm-elifecycle-sous-node-js/

    Built on Forem — the open source software that powers DEV and other inclusive communities.

    Made with love and Ruby on Rails. DEV Community © 2016 - 2024.

  •