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

后端 未结 11 1392
自闭症患者
自闭症患者 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:39

    This has been old yet consistent issue well documented at: https://github.com/nodejs/node-gyp/issues/809

    For me the error mentioned the version numbers like:

    gyp ERR! System Darwin 17.7.0
    gyp ERR! node -v v12.1.0
    gyp ERR! node-gyp -v v3.8.0
    

    After attempting all the possible combinations of solutions (modify ~/.npmrc, remove ~/.node-gyp, clear the npm cache, delete node_modules and even restart the system), what worked with me was downgrading the node.

    I believe the versions mentioned in the log for node and node-gyp are incompatible. So I reverted to an older node version which worked like a charm.

    npm install -g node@11.10.0
    

    There should be a clear documentation describing breaking changes and compatibility issues between the two.

提交回复
热议问题