Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Install node-sass 4.5.0 failed on window 7, "Binary has a problem: Error: %1 is not a valid Win32 application.". #1888

@sdhhqb

Description

@sdhhqb

After update dependencies in package.json, run "npm install" failed when installing node-sass. I tried a few times, it seems download 'win32-x64-48_binding.node' always failed.

My node registry is set to cnpm 'http://r.cnpmjs.org/', does it influence the installation? But I can installed node-sass successfully few weeks ago when I didn't update dependencies .

Here is my dependencies in package.json.

  "dependencies": {
    "isomorphic-fetch": "^2.2.1",
    "react": "^15.4.2",
    "react-dom": "^15.4.2",
    "react-redux": "^5.0.2",
    "react-router-redux": "^4.0.7",
    "redux": "^3.6.0",
    "redux-logger": "^2.8.1",
    "redux-thunk": "^2.2.0"
  },
  "devDependencies": {
    "babel-core": "^6.22.1",
    "babel-loader": "^6.2.10",
    "babel-preset-es2015": "^6.22.0",
    "babel-preset-react": "^6.22.0",
    "babel-preset-stage-0": "^6.22.0",
    "css-loader": "^0.26.1",
    "extract-text-webpack-plugin": "^1.0.1",
    "file-loader": "^0.10.0",
    "html-webpack-plugin": "^2.28.0",
    "node-sass": "^4.5.0",
    "react-router": "^3.0.2",
    "sass-loader": "^5.0.1",
    "style-loader": "^0.13.1",
    "url-loader": "^0.5.7",
    "webpack": "^2.2.1",
    "webpack-dev-server": "^2.3.0"
  }

The error log.

E:\teach\myLearn>npm install node-sass
npm WARN deprecated [email protected]: This package is deprecated. Use Object.
assign.
npm WARN prefer global [email protected] should be installed with -g

> [email protected] install E:\teach\myLearn\node_modules\node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.5
.0/win32-x64-48_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.5.0/win3
2-x64-48_binding.node":

ESOCKETTIMEDOUT

Hint: If github.com is not accessible in your location
      try setting a proxy via HTTP_PROXY, e.g.

      export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

      npm config set proxy http://example.com:8080

> [email protected] postinstall E:\teach\myLearn\node_modules\node-sass
> node scripts/build.js

Binary found at E:\teach\myLearn\node_modules\node-sass\vendor\win32-x64-48\bind
ing.node
Testing binary
Binary has a problem: Error: %1 is not a valid Win32 application.
\\?\E:\teach\myLearn\node_modules\node-sass\vendor\win32-x64-48\binding.node
    at Error (native)
    at Object.Module._extensions..node (module.js:583:18)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at module.exports (E:\teach\myLearn\node_modules\node-sass\lib\binding.js:19
:10)
    at Object.<anonymous> (E:\teach\myLearn\node_modules\node-sass\lib\index.js:
14:35)
    at Module._compile (module.js:556:32)
Building the binary locally
Building: C:\Program Files\nodejs\node.exe E:\teach\myLearn\node_modules\node-gy
p\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_l
dflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli   'E:\\teach\\myLearn\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library=' ]
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed     at getNotFoundError (E:\teach\myLearn\node_modules\w
hich\which.js:13:12)
gyp verb `which` failed     at F (E:\teach\myLearn\node_modules\which\which.js:6
8:19)
gyp verb `which` failed     at E (E:\teach\myLearn\node_modules\which\which.js:8
0:29)
gyp verb `which` failed     at E:\teach\myLearn\node_modules\which\which.js:89:1
6
gyp verb `which` failed     at E:\teach\myLearn\node_modules\isexe\index.js:44:5

gyp verb `which` failed     at E:\teach\myLearn\node_modules\isexe\windows.js:29
:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:123:15)
gyp verb `which` failed  python2 { Error: not found: python2
gyp verb `which` failed     at getNotFoundError (E:\teach\myLearn\node_modules\w
hich\which.js:13:12)
gyp verb `which` failed     at F (E:\teach\myLearn\node_modules\which\which.js:6
8:19)
gyp verb `which` failed     at E (E:\teach\myLearn\node_modules\which\which.js:8
0:29)
gyp verb `which` failed     at E:\teach\myLearn\node_modules\which\which.js:89:1
6
gyp verb `which` failed     at E:\teach\myLearn\node_modules\isexe\index.js:44:5

gyp verb `which` failed     at E:\teach\myLearn\node_modules\isexe\windows.js:29
:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:123:15) code: 'ENOENT
' }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python C:\python27\python.EXE
gyp verb check python version `C:\python27\python.EXE -c "import platform; print
(platform.python_version());"` returned: "2.7.11\r\n"
gyp verb get node dir no --target version specified, falling back to host node v
ersion: 6.7.0
gyp verb command install [ '6.7.0' ]
gyp verb install input version string "6.7.0"
gyp verb install installing version: 6.7.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 6.7.0
gyp verb build dir attempting to create "build" dir: E:\teach\myLearn\node_modul
es\node-sass\build
gyp verb build dir "build" dir needed to be created? E:\teach\myLearn\node_modul
es\node-sass\build
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: E:\teach\myLearn\node_module
s\node-sass\build\config.gypi
gyp verb config.gypi checking for gypi file: E:\teach\myLearn\node_modules\node-
sass\config.gypi
gyp verb common.gypi checking for gypi file: E:\teach\myLearn\node_modules\node-
sass\common.gypi
gyp verb gyp gyp format was not specified; forcing "msvs"
gyp info spawn C:\python27\python.EXE
gyp info spawn args [ 'E:\\teach\\myLearn\\node_modules\\node-gyp\\gyp\\gyp_main
.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-G',
gyp info spawn args   'msvs_version=auto',
gyp info spawn args   '-I',
gyp info spawn args   'E:\\teach\\myLearn\\node_modules\\node-sass\\build\\confi
g.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'E:\\teach\\myLearn\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\Administrator\\.node-gyp\\6.7.0\\include\\node
\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\Administrator\\.node-gyp\\6.7.
0',
gyp info spawn args   '-Dnode_gyp_dir=E:\\teach\\myLearn\\node_modules\\node-gyp
',
gyp info spawn args   '-Dnode_lib_file=node.lib',
gyp info spawn args   '-Dmodule_root_dir=E:\\teach\\myLearn\\node_modules\\node-
sass',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'E:\\teach\\myLearn\\node_modules\\node-sass\\build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp verb command build []
gyp verb build type Release
gyp verb architecture x64
gyp verb node dev dir C:\Users\Administrator\.node-gyp\6.7.0
gyp verb found first Solution file build/binding.sln
gyp verb could not find "msbuild.exe" in PATH - finding location in registry
gyp verb "Release" dir needed to be created? null
gyp verb copying "node.lib" for x64 C:\Users\Administrator\.node-gyp\6.7.0\Relea
se\node.lib
gyp info spawn C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]
在此解决方案中一次生成一个项目。若要启用并行生成,请添加“/m”开关。
生成启动时间为 2017/2/9 16:53:05。
节点 1 上的项目“E:\teach\myLearn\node_modules\node-sass\build\binding.sln”(默
认目标)。
ValidateSolutionConfiguration:
  正在生成解决方案配置“Release|x64”。
MSBUILD : error MSB3428: 未能加载 Visual C++ 组件“VCBuild.exe”。要解决此问题,
1) 安装 .NET Fram
ework 2.0 SDK;2) 安装 Microsoft Visual Studio 2005;或 3) 如果将该组件安装到了
其他位置,请将其位置添加到系统
路径中。 [E:\teach\myLearn\node_modules\node-sass\build\binding.sln]
已完成生成项目“E:\teach\myLearn\node_modules\node-sass\build\binding.sln”(默认
目标)的操作 - 失
败。


生成失败。

“E:\teach\myLearn\node_modules\node-sass\build\binding.sln”(默认目标) (1) ->
(_src_\libsass 目标) ->
  MSBUILD : error MSB3428: 未能加载 Visual C++ 组件“VCBuild.exe”。要解决此问题
,1) 安装 .NET Fr
amework 2.0 SDK;2) 安装 Microsoft Visual Studio 2005;或 3) 如果将该组件安装到
了其他位置,请将其位置添加到
系统路径中。 [E:\teach\myLearn\node_modules\node-sass\build\binding.sln]

    0 个警告
    1 个错误

已用时间 00:00:00.05
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (E:\teach\myLearn\node_modules\node-gy
p\lib\build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_proces
s.js:215:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "E:\\teach\\myLearn\\node
_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--
libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd E:\teach\myLearn\node_modules\node-sass
gyp ERR! node -v v6.7.0
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fseve
[email protected]
npm WARN [email protected] requires a peer of webpack@^1.9.11 bu
t none was installed.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\
node_modules\\npm\\bin\\npm-cli.js" "install" "node-sass"
npm ERR! node v6.7.0
npm ERR! npm  v3.10.3
npm ERR! code ELIFECYCLE

npm ERR! [email protected] postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node scripts/build.js
'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node scripts/build.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs node-sass
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls node-sass
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     E:\teach\myLearn\npm-debug.log

When reporting an bug, you must provide this information:

  • NPM version (npm -v):
    3.10.3
  • Node version (node -v):
    6.7.0
  • Node Process (node -p process.versions):
    { http_parser: '2.7.0
    node: '6.7.0',
    v8: '5.1.281.83',
    uv: '1.9.1',
    zlib: '1.2.8',
    ares: '1.10.1-DEV',
    icu: '57.1',
    modules: '48',
    openssl: '1.0.2j' }
  • Node Platform (node -p process.platform):
    win32
  • Node architecture (node -p process.arch):
    x64
  • node-sass version (node -p "require('node-sass').info"):
    module.js:583
    return process.dlopen(module, path._makeLong(filename));
    ^

Error: The process cannot access the file because it is being used by another pr
ocess.
\?\E:\teach\myLearn\node_modules\node-sass\vendor\win32-x64-48\binding.node
at Error (native)
at Object.Module._extensions..node (module.js:583:18)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at module.exports (E:\teach\myLearn\node_modules\node-sass\lib\binding.js:19
:10)
at Object. (E:\teach\myLearn\node_modules\node-sass\lib\index.js:
14:35)
at Module._compile (module.js:556:32)

npm ERR! peer dep missing: webpack@^1.9.11, required by extract-text-webpack-plu
[email protected]

When encountering a syntax, or compilation issue:

If you delete this text without following it, your issue will be closed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions