GYP ERR! build error. stack Error: 'make' failed with exit code 2

后端 未结 11 1367
自闭症患者
自闭症患者 2021-01-07 16:30

I am currently working on a nodejs web application I am having trouble pushing the application online with cloud foundry. I did some research on the errors and it seems that

相关标签:
11条回答
  • 2021-01-07 16:45

    Delete the ~/.node-gyp folder and then the ~/.npmrc file.

    Reboot your server and rerun npm install in your project folder

    Edit:

    Warning: removing ~/.npmrc will delete your other configurations

    0 讨论(0)
  • 2021-01-07 16:48

    It worked after deleting package-lock.json and re run npm install

    If you are using yarn to build your program delete yarn.lock and re run yarn install

    0 讨论(0)
  • 2021-01-07 16:53

    Figured out the issue. Some of the npm packages were not up to date. I modified the package.json to install all the latest versions of all packages and the error was fixed.

    0 讨论(0)
  • 2021-01-07 16:54

    In our case (since make failed), this issue could be resolved by installing the build / development tools:

    Ubuntu / Debian:

    apt-get install -y build-essential
    

    CentOS:

    yum install gcc gcc-c++ make 
    

    Fedora 23 and above:

    dnf install @development-tools
    

    If this is not the solution, you might want to try to upgrade or downgrade node, remove package-lock.json and the node_modules folder, and then re-run npm install.

    0 讨论(0)
  • 2021-01-07 16:57

    Follow these steps to resolve the issue.

    • Make sure you have build-tools installed.
    • Update node-gyp
    • Delete package-lock.json and node modules folder and run npm install again.
    • Deleting ~/.node-gyp folder and run npm install again.

    Source: https://codeforgeek.com/make-failed-with-exit-code-2/

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