Skip to content

Native code compile failed error #1991

Closed

Description

@magiccrafter
  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
    Windows 7, Mac OSX Yosemite, CentOS 6.5
  2. Versions. Please run ng --version. If there's nothing outputted, please run
    in a Terminal: node --version and paste the result here:
    angular-cli: 1.0.0-beta.11-webpack.8
    node: 6.5.0
    os: win32 x64
    npm: 3.10.3
  3. Repro steps. Was this an app that wasn't created using the CLI? What change did you
    do on your code? etc.
    yes.
    dependencies: angular2-material, redux
  4. The log given by the failure. Normally this include a stack trace and some
    more information.
D:\ws\app-ui-webpack>npm install
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'np
 the tree.
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated lodash-node@2.4.1: This package has been discontinued in favor of lodash@^4.0.0.
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated tough-cookie@2.2.2: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
npm WARN prefer global marked@0.3.6 should be installed with -g
npm WARN prefer global npm@3.10.2 should be installed with -g
npm WARN prefer global node-gyp@3.4.0 should be installed with -g

> execSync@1.0.2 install D:\ws\app-ui-webpack\node_modules\execSync
> node install.js

[execsync v1.0.2] Attempting to compile native extensions.
{ Error: spawn node-gyp ENOENT
    at exports._errnoException (util.js:1026:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
    at onErrorNT (internal/child_process.js:359:16)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
    at Module.runMain (module.js:592:11)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3
  code: 'ENOENT',
  errno: 'ENOENT',
  syscall: 'spawn node-gyp',
  path: 'node-gyp',
  spawnargs: [ 'rebuild' ] }
[execSync v1.0.2]
    Native code compile failed!!
    Will try to use win32 extension.

> node-zopfli@1.4.0 install D:\ws\app-ui-webpack\node_modules\node-zopfli
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download: https://node-zopfli.s3.amazonaws.com/Release/zopfli-v1.4.0-node-v48-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for node-zopfli@1.4.0 and node@6.5.0 (node-v48 ABI) (falling back to source compile with node-gyp)
  1. Mention any other details that might be useful.
    Happens on all platforms (MacOSX, Linux, Windows).
    The common error in all is:
[execSync v1.0.2]
    Native code compile failed!!

Thanks! We'll be in touch soon.

Activity

  1. changed the title [-]Native code compile failed[/-] [+]Native code compile failed error[/+] on Sep 6, 2016
  2. filipesilva commented on Sep 16, 2016

    @filipesilva
    Contributor
  3. added
    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
    on Sep 16, 2016
  4. kucharzyk commented on Sep 16, 2016

    @kucharzyk

    Temporary solution can be disabling compression-webpack-plugin until it will be fixed.

    angular-cli works well for me but throws this error message every time I install new package in my project.

    It may look scary for new users.

  5. filipesilva commented on Sep 22, 2016

    @filipesilva
    Contributor

    It might look scary but it's not a npm install error. Everything works fine regardless.

  6. muralikrrish279 commented on Nov 4, 2016

    @muralikrrish279

    Which version of Angular-cli would fix this problem?

    Or is there a way to turnoff this compression as it doesn't have any side effects on build output anyway.

  7. filipesilva commented on Nov 4, 2016

    @filipesilva
    Contributor

    @muralikrrish279 latest versions have this fixed.

  8. muralikrrish279 commented on Nov 4, 2016

    @muralikrrish279

    "devDependencies": {
    "angular-cli": "1.0.0-beta.19-3",

    I am still facing this issue even after upgrading to '1.0.0-beta.19-3' which is latest I found in npm. We cant ignore this error as msbuild is failing in the cloud continuous integration.

    I can see latest compression-webpack-plugin also in the Angular-cli package.json installed in my machine

     "awesome-typescript-loader": "^2.2.3",
        "chalk": "^1.1.3",
        "common-tags": "^1.3.1",
        "compression-webpack-plugin": "^0.3.2",
        "core-js": "^2.4.0",
        "css-loader": "^0.23.1"
    
  9. filipesilva commented on Nov 4, 2016

    @filipesilva
    Contributor

    @muralikrrish279 can you open a new issue with full description of what you're experiencing? The problem described in this issue does not result in a failure of npm install, so it shouldn't break any CI server.

  10. speige commented on Nov 18, 2016

    @speige

    TLDR:
    Add
    "npm install execSync --ignore-scripts"
    before your normal
    "npm install"
    in your build script.

    Long explanation

    I was having this issue as well because my CI server considered an error in npm install to be a failure of the whole build.

    execSync has an install.js file which calls node-gyp on itself to compile it's native c++ code. The actual c++ compile errors are supressed by install.js, but you can see them by calling "node-gyp rebuild --msvs_version=2015" directly from the node_modules\execSync directory. They look like legit c++ compile errors, maybe because execSync was written off visual c++ 2012 & I don't have that installed?

    The only module which uses execSync is codeCov. In my case I'm choosing not to write unit tests (please flame me :), so I don't care if codeCov's dependency is not installed correctly.

    I was using MSBuild on Windows 10 with latest versions of node/npm/angular/etc.
    This in the updated section in my .xproj file:

  11. alarv commented on Dec 6, 2016

    @alarv

    In my case the errors were:

    node-pre-gyp ERR! Tried to download(403): https://node-zopfli.s3.amazonaws.com/Release/zopfli-v2.0.2-node-v51-linux-x64.tar.gz 
    node-pre-gyp ERR! Pre-built binaries not found for node-zopfli@2.0.2 and node@7.2.0 (node-v51 ABI) (falling back to source compile with node-gyp) 
    make: Entering directory '/usr/local/lib/node_modules/angular-cli/node_modules/node-zopfli/build'
      CXX(target) Release/obj.target/zopfli/src/zopfli-binding.o
    **make: g++: Command not found**
    

    make: g++: Command not found

    The issue was therefore solved using:
    sudo apt-get install build-essential g++

  12. angular-automatic-lock-bot commented on Sep 6, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  13. locked and limited conversation to collaborators on Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgenttype: bug/fix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions