node-gyp error while doing npm install

后端 未结 2 1971
悲哀的现实
悲哀的现实 2020-12-30 09:04

I am doing npm install from a project and I am getting this wierd error in node-gyp.

> pty.js@0.2.3 install /home/charizard/Open/terminal-codelearn/node_m         


        
2条回答
  •  悲&欢浪女
    2020-12-30 09:49

    The reason this happens is that node-gyp evaluates the -pre part of node@0.11.8-pre as -1. The install then receives a 404 and fails.

    gyp http GET http://nodejs.org/dist/v0.8.-1/node-v11.8.-1.tar.gz
    gyp http 404 http://nodejs.org/dist/v0.8.-1/node-v11.8.-1.tar.gz
    

    To solve this problem, use a stable release of Node.js. Otherwise, you need to have the Node source lying around, and use the --nodedir flag.

    npm install --nodedir=/node/src/
    

    You can read more about this issue here.

提交回复
热议问题