How to solve npm error “npm ERR! code ELIFECYCLE”

后端 未结 30 2165
死守一世寂寞
死守一世寂寞 2020-11-22 02:33

I\'m trying to learn react, so I have this sample code for the full-stack react voting app, and I am trying to get it to work but after running npm install followed by npm s

相关标签:
30条回答
  • 2020-11-22 02:45

    I've been bothered by this issue for a long time. For me, the version of node was the problem.

    My npm and node were 6.1.0 and 8.11.3, respectively. However, I didn't realize that I had updated my node accidentally to 12.*.*.

    It then began to install GCX stuff whenever npm i, which was unnecessary before.

    I downgraded my node to 8 and it worked!

    0 讨论(0)
  • 2020-11-22 02:45

    I'm using ubuntu 18.04 LTS release and I faced the same problem I tried to clean cache as above suggestions but it didn't work for me. However, I found another solution.

    echo 65536 | sudo tee -a /proc/sys/fs/inotify/max_user_watches

    npm start

    I run this command and it started to work

    0 讨论(0)
  • 2020-11-22 02:47

    Faced this exact problem,

    for me it worked by deleting package-lock.json and re run npm install

    if it doesn't resolve try

    1. delete package-lock.json
    2. npm cache clean --force
    3. npm install
    4. npm start
    0 讨论(0)
  • 2020-11-22 02:47
    npm install --unsafe-perm
    

    worked for me. See https://docs.npmjs.com/. The --unsafe-perm parameter lets you run the scripts from the package instalation as root. The problem in my case was that some depandencies failed to install.

    0 讨论(0)
  • 2020-11-22 02:48

    This solution is for Windows users.

    You can open the node.js installer and give the installer some time to compute space requirements and then click next and click remove. This will remove node.js from your computer and again reopen the installer and install it in this path - C:\Windows\System32

    or

    Cleaning Cache and Node_module will work. Follow this steps:

    • npm cache clean --force
    • delete node_modules folder
    • delete package-lock.json file
    • npm install
    0 讨论(0)
  • 2020-11-22 02:50

    I did follow steps, it works:

    1.

    npm cache clean --force
    
    1. remove the package-lock.json file

    2. restart my WebStorm

    0 讨论(0)
提交回复
热议问题