为了账号安全,请及时绑定邮箱和手机立即绑定

安装node sass错误

> node-sass@4.11.0 install E:\web\web\node_modules\node-sass

> node scripts/install.js


node-sass build Binary found at F:\Program Files\win32-x64-57_binding.node


> node-sass@4.11.0 postinstall E:\web\web\node_modules\node-sass

> node scripts/build.js


Binary found at F:\Program Files\win32-x64-57_binding.node

Testing binary

Binary has a problem: Error: The module '\\?\F:\Program Files\win32-x64-57_binding.node'

was compiled against a different Node.js version using

NODE_MODULE_VERSION 57. This version of Node.js requires

NODE_MODULE_VERSION 64. Please try re-compiling or re-installing

the module (for instance, using `npm rebuild` or `npm install`).

    at Object.Module._extensions..node (internal/modules/cjs/loader.js:717:18)

    at Module.load (internal/modules/cjs/loader.js:598:32)

    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)

    at Function.Module._load (internal/modules/cjs/loader.js:529:3)

    at Module.require (internal/modules/cjs/loader.js:636:17)

    at require (internal/modules/cjs/helpers.js:20:18)

    at module.exports (E:\web\web\node_modules\node-sass\lib\binding.js:19:10)

    at Object.<anonymous> (E:\web\web\node_modules\node-sass\lib\index.js:14:35)

    at Module._compile (internal/modules/cjs/loader.js:688:30)

    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)

Building the binary locally

Building: C:\Program Files\nodejs\node.exe E:\web\web\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=

gyp info it worked if it ends with ok

gyp verb cli [ 'C:\\Program Files\\nodejs\\node.exe',

gyp verb cli   'E:\\web\\web\\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 node-gyp@3.8.0

gyp info using node@10.14.1 | 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:\web\web\node_modules\which\which.js:13:12)

gyp verb `which` failed     at F (E:\web\web\node_modules\which\which.js:68:19)

gyp verb `which` failed     at E (E:\web\web\node_modules\which\which.js:80:29)

gyp verb `which` failed     at E:\web\web\node_modules\which\which.js:89:16

gyp verb `which` failed     at E:\web\web\node_modules\isexe\index.js:42:5

gyp verb `which` failed     at E:\web\web\node_modules\isexe\windows.js:36:5

gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:154:21)

gyp verb `which` failed  python2 { Error: not found: python2

gyp verb `which` failed     at getNotFoundError (E:\web\web\node_modules\which\which.js:13:12)

gyp verb `which` failed     at F (E:\web\web\node_modules\which\which.js:68:19)

gyp verb `which` failed     at E (E:\web\web\node_modules\which\which.js:80:29)

gyp verb `which` failed     at E:\web\web\node_modules\which\which.js:89:16

gyp verb `which` failed     at E:\web\web\node_modules\isexe\index.js:42:5

gyp verb `which` failed     at E:\web\web\node_modules\isexe\windows.js:36:5

gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:154:21)

gyp verb `which` failed   stack:

gyp verb `which` failed    'Error: not found: python2\n    at getNotFoundError (E:\\web\\web\\node_modules\\which\\which.js:13:12)\n    at F (E:\\web\\web\\node_modules\\which\\which.js:68:19)\n    at E (E:\\web\\web\\node_modules\\which\\which.js:80:29)\n    at E:\\web\\web\\node_modules\\which\\which.js:89:16\n    at E:\\web\\web\\node_modules\\isexe\\index.js:42:5\n    at E:\\web\\web\\node_modules\\isexe\\windows.js:36:5\n    at FSReqWrap.oncomplete (fs.js:154:21)',

gyp verb `which` failed   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 sys; print "2.7.2

gyp verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j

gyp verb get node dir no --target version specified, falling back to host node version: 10.14.1

gyp verb command install [ '10.14.1' ]

gyp verb install input version string "10.14.1"

gyp verb install installing version: 10.14.1

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: 10.14.1

gyp verb build dir attempting to create "build" dir: E:\web\web\node_modules\node-sass\build

gyp verb build dir "build" dir needed to be created? E:\web\web\node_modules\node-sass\build

gyp verb Not using VS2017: Could not use PowerShell to find VS2017

gyp verb build/config.gypi creating config file

gyp verb build/config.gypi writing out config file: E:\web\web\node_modules\node-sass\build\config.gypi

gyp verb config.gypi checking for gypi file: E:\web\web\node_modules\node-sass\config.gypi

gyp verb common.gypi checking for gypi file: E:\web\web\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:\\web\\web\\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:\\web\\web\\node_modules\\node-sass\\build\\config.gypi',

gyp info spawn args   '-I',

gyp info spawn args   'E:\\web\\web\\node_modules\\node-gyp\\addon.gypi',

gyp info spawn args   '-I',

gyp info spawn args   'C:\\Users\\Administrator\\.node-gyp\\10.14.1\\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\\10.14.1',

gyp info spawn args   '-Dnode_gyp_dir=E:\\web\\web\\node_modules\\node-gyp',

gyp info spawn args   '-Dnode_lib_file=C:\\Users\\Administrator\\.node-gyp\\10.14.1\\<(target_arch)\\node.lib',

gyp info spawn args   '-Dmodule_root_dir=E:\\web\\web\\node_modules\\node-sass',

gyp info spawn args   '-Dnode_engine=v8',

gyp info spawn args   '--depth=.',

gyp info spawn args   '--no-parallel',

gyp info spawn args   '--generator-output',

gyp info spawn args   'E:\\web\\web\\node_modules\\node-sass\\build',

gyp info spawn args   '-Goutput_dir=.' ]

Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation

Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation

Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation

Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation

gyp verb command build []

gyp verb build type Release

gyp verb architecture x64

gyp verb node dev dir C:\Users\Administrator\.node-gyp\10.14.1

gyp verb found first Solution file build/binding.sln

gyp verb could not find "msbuild.exe" in PATH - finding location in registry

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”开关。

生成启动时间为 2018/12/24 15:41:41。

MSBUILD : error MSB4132: 无法识别工具版本“2.0”。可用的工具版本为 "4.0"。


生成失败。


  MSBUILD : error MSB4132: 无法识别工具版本“2.0”。可用的工具版本为 "4.0"。


    0 个警告

    1 个错误


已用时间 00:00:00.69

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:\web\web\node_modules\node-gyp\lib\build.js:262:23)

gyp ERR! stack     at ChildProcess.emit (events.js:182:13)

gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)

gyp ERR! System Windows_NT 10.0.17134

gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "E:\\web\\web\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="

gyp ERR! cwd E:\web\web\node_modules\node-sass

gyp ERR! node -v v10.14.1

gyp ERR! node-gyp -v v3.8.0

gyp ERR! not ok

Build failed with error code: 1

npm WARN ajv-keywords@3.2.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.


npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! node-sass@4.11.0 postinstall: `node scripts/build.js`

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the node-sass@4.11.0 postinstall script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.


npm ERR! A complete log of this run can be found in:

npm ERR!     C:\Program Files\nodejs\node_cache\_logs\2018-12-24T07_41_43_096Z-debug.log


正在回答

5 回答

同求问题答案

0 回复 有任何疑惑可以回复我~

sudo npm install node-pre-gyp -D 

sudo npm install node-sass --unsafe-perm --save-dev

就这样

0 回复 有任何疑惑可以回复我~
#1

慕运维6043628

sudo显示无法识别怎么办
2023-07-18 回复 有任何疑惑可以回复我~
#2

慕运维6043628 回复 慕运维6043628

window上不能用sudo,那这个问题该怎么解决?
2023-07-18 回复 有任何疑惑可以回复我~

一样的问题  现在在找答案  找到了 帮助下你  你已经解决了 快告诉我



0 回复 有任何疑惑可以回复我~

有可能是权限不足,如果是windows系统,那么就采用管理员命令行试试

0 回复 有任何疑惑可以回复我~

https://img1.sycdn.imooc.com//5c2093b40001badd09280649.jpg。。。

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

安装node sass错误

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信