`node-pre-gyp install --fallback-to-build` failed during MeanJS installation on OSX

后端 未结 16 2078
遇见更好的自我
遇见更好的自我 2020-12-13 23:59

I just bought myself a mac book after using Windows for a long time.

I was trying to work on a MeanJS project that I had been working on. Doing npm install

相关标签:
16条回答
  • 2020-12-14 00:27

    This might not work for everyone, but I updated node and it fixed the issue for me when none of the above did

    0 讨论(0)
  • 2020-12-14 00:29

    try these

    sudo chown -R $(whoami) ~/.npm

    sudo chown -R $(whoami) /usr/local/lib

    sudo chown -R $(whoami) /usr/local/bin

    Then try your command again without sudo. e.g.

    npm install -g npm@latest

    Check this link for more details

    0 讨论(0)
  • 2020-12-14 00:30

    This seems issue with my node upgrade. How ever I solved it with the following approach.

    First uninstall the cli, clear cashe, and reinstall with these commands

    npm uninstall -g @angular/cli
    npm cache clean
    npm install -g @angular/cli
    

    Then install node-pre-gyp

    npm install -g node-pre-gyp
    

    Restart your terminal and see if the issue is solved.

    0 讨论(0)
  • 2020-12-14 00:31

    russfrisch commented 4 days ago:

    I was experiencing this same issue. Changing in the version for grunt-node-inspector to prepend a ">=" instead of a "~" got this to work for me.

    Link to github page where I found this solution.

    Link to my post on StackoverFlow

    0 讨论(0)
  • 2020-12-14 00:32

    As @ocean800 stated I updated node. The below solution is for Ubuntu 16.04 that worked for me, but something similar on OSX may fix this issue.

    On Ubuntu 16.04, what worked for me was upgrading node

    updating nodejs on ubuntu 16.04

    I am replicating solution from the above link below

    To update, you can install n

    sudo npm install -g n
    

    Then just :

    sudo n latest
    

    or a specific version

    sudo n 8.9.0
    

    Then try and install

    sudo npm install <package>
    
    0 讨论(0)
  • 2020-12-14 00:32

    are you running the example from the node_modules folder?

    They are not supposed to be ran from there.

    Create the following file on your project instead:

    post-data.js

    var Curl = require( 'node-libcurl' ).Curl,
       querystring = require( 'querystring' );
    
    var curl = new Curl(),
      url  = 'http://posttestserver.com/post.php',
    data = { //Data to send, inputName : value
        'input-arr[0]' : 'input-arr-val0',
        'input-arr[1]' : 'input-arr-val1',
        'input-arr[2]' : 'input-arr-val2',
        'input-name' : 'input-val'
    };
    
    //You need to build the query string, 
    // node has this helper function, but it's limited for real use cases (no support for 
    array values for example)
    data = querystring.stringify( data );
    
     curl.setOpt( Curl.option.URL, url );
     curl.setOpt( Curl.option.POSTFIELDS, data );
     curl.setOpt( Curl.option.HTTPHEADER, ['User-Agent: node-libcurl/1.0'] );
     curl.setOpt( Curl.option.VERBOSE, true );
    
     console.log( querystring.stringify( data ) );
    
     curl.perform();
    
     curl.on( 'end', function( statusCode, body ) {
    
    console.log( body );
    
    this.close();
    });
    
    curl.on( 'error', curl.close.bind( curl ) );
    

    Run with node post-data.js

    ref:https://github.com/JCMais/node-libcurl/issues/98

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