Repository navigation
Native code compile failed error #1991
Copy link
Copy link
Closed
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgenttype: bug/fix
Description
- OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
Windows 7, Mac OSX Yosemite, CentOS 6.5 - Versions. Please run
ng --version. If there's nothing outputted, please run
in a Terminal:node --versionand paste the result here:
angular-cli: 1.0.0-beta.11-webpack.8
node: 6.5.0
os: win32 x64
npm: 3.10.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 - 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)
- 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.
Metadata
Metadata
Assignees
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgenttype: bug/fix
Activity
[-]Native code compile failed[/-][+]Native code compile failed error[/+]filipesilva commentedon Sep 16, 2016
Blocked on webpack/compression-webpack-plugin#34.
kucharzyk commentedon Sep 16, 2016
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.
filipesilva commentedon Sep 22, 2016
It might look scary but it's not a npm install error. Everything works fine regardless.
muralikrrish279 commentedon Nov 4, 2016
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.
filipesilva commentedon Nov 4, 2016
@muralikrrish279 latest versions have this fixed.
muralikrrish279 commentedon Nov 4, 2016
"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
filipesilva commentedon Nov 4, 2016
@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.speige commentedon Nov 18, 2016
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:
alarv commentedon Dec 6, 2016
In my case the errors were:
make: g++: Command not found
The issue was therefore solved using:
sudo apt-get install build-essential g++angular-automatic-lock-bot commentedon Sep 6, 2019
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.