x***@163.com
x***@163.com
  • 发布:2019-12-02 18:56
  • 更新:2019-12-02 19:40
  • 阅读:878

sass 编译错误

分类:HBuilderX

Hbuilder x 2.4.2.2 在编译项目时候 项目使用了 sass插件 安装插件成功 但是继续编译报如下错误:
18:47:35.928 Module build failed (from ./node_modules/sass-loader/lib/loader.js):
18:47:35.928 Error: \?\C:\Users**\AppData\Roaming\npm\node_modules\node-sass\vendor\win32-x64-64\binding.node is not a valid Win32 application.
18:47:35.936 \?\C:\Users\
\AppData\Roaming\npm\node_modules\node-sass\vendor\win32-x64-64\binding.node
18:47:35.942 at Object.Module._extensions..node (module.js:681:18)
18:47:35.943 at Module.load (module.js:565:32)
18:47:35.948 at tryModuleLoad (module.js:505:12)
18:47:35.948 at Function.Module._load (module.js:497:3)

2019-12-02 18:56 负责人:无 分享
已邀请:
DCloud_HB_WDL

DCloud_HB_WDL

尝试解决办法:进入HBuilderX所在plugins目录下,找到sass插件,删除node-modules, 执行npm install 重装一下

  • x***@163.com (作者)

    谢谢 已经解决 下载的版本确实错误了

    2019-12-11 16:41

  • 小聪聪

    回复 x***@163.com: 需要下载多少版本的

    2020-02-18 00:13

  • 3***@qq.com

    Microsoft Windows [版本 10.0.22000.1936]

    (c) Microsoft Corporation。保留所有权利。


    C:\公司项目文件夹\工具\HBuilderX.3.8.4.20230531\HBuilderX\plugins\compile-node-sass>npm install

    npm WARN old lockfile

    npm WARN old lockfile The package-lock.json file was created with an old version of npm,

    npm WARN old lockfile so supplemental metadata must be fetched from the registry.

    npm WARN old lockfile

    npm WARN old lockfile This is a one-time fix-up, please be patient...

    npm WARN old lockfile

    npm WARN deprecated har-validator@5.1.3: this library is no longer supported

    npm WARN deprecated cryptiles@2.0.5: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).

    npm WARN deprecated boom@2.10.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).

    npm WARN deprecated sntp@1.0.9: This module moved to @hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.

    npm WARN deprecated hoek@2.16.3: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).

    npm WARN deprecated request@2.79.0: request has been deprecated, see https://github.com/request/request/issues/3142

    npm WARN deprecated request@2.88.0: request has been deprecated, see https://github.com/request/request/issues/3142

    npm WARN deprecated uuid@3.3.2: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.

    npm WARN deprecated mkdirp@0.5.1: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)

    npm WARN deprecated har-validator@2.0.6: this library is no longer supported

    npm WARN deprecated hawk@3.1.3: This module moved to @hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.

    npm WARN deprecated tar@2.2.1: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.

    npm ERR! code 1

    npm ERR! path C:\公司项目文件夹\工具\HBuilderX.3.8.4.20230531\HBuilderX\plugins\compile-node-sass\node_modules\node-sass-china

    npm ERR! command failed

    npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node scripts/build.js

    npm ERR! Binary found at C:\Program Files\nodejs\node_sass\win32-x64-83_binding.node

    npm ERR! Testing binary

    npm ERR! Binary has a problem: Error: \?\C:\Program Files\nodejs\node_sass\win32-x64-83_binding.node is not a valid Win32 application.

    npm ERR! \?\C:\Program Files\nodejs\node_sass\win32-x64-83_binding.node

    npm ERR! at Object.Module._extensions..node (node:internal/modules/cjs/loader:1280:18)

    npm ERR! at Module.load (node:internal/modules/cjs/loader:1074:32)

    npm ERR! at Function.Module._load (node:internal/modules/cjs/loader:909:12)

    npm ERR! at Module.require (node:internal/modules/cjs/loader:1098:19)

    npm ERR! at require (node:internal/modules/cjs/helpers:108:18)

    npm ERR! at module.exports (C:\公司项目文件夹\工具\HBuilderX.3.8.4.20230531\HBuilderX\plugins\compile-node-sass\node_modules\node-sass-china\lib\binding.js:19:10)

    npm ERR! at Object.<anonymous> (C:\公司项目文件夹\工具\HBuilderX.3.8.4.20230531\HBuilderX\plugins\compile-node-sass\node_modules\node-sass-china\lib\index.js:14:35)

    npm ERR! at Module._compile (node:internal/modules/cjs/loader:1196:14)

    npm ERR! at Object.Module._extensions..js (node:internal/modules/cjs/loader:1250:10)

    npm ERR! at Module.load (node:internal/modules/cjs/loader:1074:32) {

    npm ERR! code: 'ERR_DLOPEN_FAILED'

    npm ERR! }

    npm ERR! Building the binary locally

    npm ERR! Building: C:\Program Files\nodejs\node.exe C:\公司项目文件夹\工具\HBuilderX.3.8.4.20230531\HBuilderX\plugins\compile-node-sass\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=

    npm ERR! gyp info it worked if it ends with ok

    npm ERR! gyp verb cli [

    npm ERR! gyp verb cli 'C:\Program Files\nodejs\node.exe',

    npm ERR! gyp verb cli 'C:\公司项目文件夹\工具\HBuilderX.3.8.4.20230531\HBuilderX\plugins\compile-node-sass\node_modules\node-gyp\bin\node-gyp.js',

    npm ERR! gyp verb cli 'rebuild',

    npm ERR! gyp verb cli '--verbose',

    npm ERR! gyp verb cli '--libsass_ext=',

    npm ERR! gyp verb cli '--libsass_cflags=',

    npm ERR! gyp verb cli '--libsass_ldflags=',

    npm ERR! gyp verb cli '--libsass_library='

    npm ERR! gyp verb cli ]

    npm ERR! gyp info using node-gyp@3.8.0

    npm ERR! gyp info using node@16.20.0 | win32 | x64

    npm ERR! gyp verb command rebuild []

    npm ERR! gyp verb command clean []

    npm ERR! gyp verb clean removing "build" directory

    npm ERR! gyp verb command configure []

    npm ERR! gyp verb check python checking for Python executable "python2" in the PATH

    npm ERR! gyp verb which failed Error: not found: python2

    npm ERR! gyp verb which failed at getNotFoundError (C:\公司项目文件夹\工具\HBuilderX.3.8.4.20230531\HBuilderX\plugins\compile-node-sass\node_modules\which\which.js:13:12)

    npm ERR! gyp verb which failed at F (C:\公司项目文件夹\工具\HBuilderX.3.8.4.20230531\HBuilderX\plugins\compile-node-sass\node_modules\which\which.js:68:19)

    npm ERR! gyp verb which failed at E (C:\公司项目文件夹\工具\HBuilderX.3.8.4.20230531\HBuilderX\plugins\compile-node-sass\node_modules\which\which.js:80:29)

    npm ERR! gyp verb which failed at C:\公司项目文件夹\工具\HBuilderX.3.8.4.20230531\HBuilderX\plugins\compile-node-sass\node_modules\which\which.js:89:16

    npm ERR! gyp verb which failed at C:\公司项目文件夹\工具\HBuilderX.3.8.4.20230531\HBuilderX\plugins\compile-node-sass\node_modules\isexe\index.js:42:5

    npm ERR! gyp verb which failed at C:\公司项目文件夹\工具\HBuilderX.3.8.4.20230531\HBuilderX\plugins\compile-node-sass\node_modules\isexe\windows.js:36:5

    npm ERR! gyp verb which failed at FSReqCallback.oncomplete (node:fs:202:21)

    npm ERR! gyp verb which failed python2 Error: not found: python2

    npm ERR! gyp verb which failed at getNotFoundError (C:\公司项目文件夹\工具\HBuilderX.3.8.4.20230531\HBuilderX\plugins\compile-node-sass\node_modules\which\which.js:13:12)

    npm ERR! gyp verb which failed at F (C:\公司项目文件夹\工具\HBuilderX.3.8.4.20230531\HBuilderX\plugins\compile-node-sass\node_modules\which\which.js:68:19)

    npm ERR! gyp verb which failed at E (C:\公司项目文件夹\工具\HBuilderX.3.8.4.20230531\HBuilderX\plugins\compile-node-sass\node_modules\which\which.js:80:29)

    npm ERR! gyp verb which failed at C:\公司项目文件夹\工具\HBuilderX.3.8.4.20230531\HBuilderX\plugins\compile-node-sass\node_modules\which\which.js:89:16

    npm ERR! gyp verb which failed at C:\公司项目文件夹\工具\HBuilderX.3.8.4.20230531\HBuilderX\plugins\compile-node-sass\node_modules\isexe\index.js:42:5

    npm ERR! gyp verb which failed at C:\公司项目文件夹\工具\HBuilderX.3.8.4.20230531\HBuilderX\plugins\compile-node-sass\node_modules\isexe\windows.js:36:5

    npm ERR! gyp verb which failed at FSReqCallback.oncomplete (node:fs:202:21) {

    npm ERR! gyp verb which failed code: 'ENOENT'

    npm ERR! gyp verb which failed }

    npm ERR! gyp verb check python checking for Python executable "python" in the PATH

    npm ERR! gyp verb which failed Error: not found: python

    npm ERR! gyp verb which failed at getNotFoundError (C:\公司项目文件夹\工具\HBuilderX.3.8.4.20230531\HBuilderX\plugins\compile-node-sass\node_modules\which\which.js:13:12)

    npm ERR! gyp verb which failed at F (C:\公司项目文件夹\工具\HBuilderX.3.8.4.20230531\HBuilderX\plugins\compile-node-sass\node_modules\which\which.js:68:19)

    npm ERR! gyp verb which failed at E (C:\公司项目文件夹\工具\HBuilderX.3.8.4.20230531\HBuilderX\plugins\compile-node-sass\node_modules\which\which.js:80:29)

    npm ERR! gyp verb which failed at C:\公司项目文件夹\工具\HBuilderX.3.8.4.20230531\HBuilderX\plugins\compile-node-sass\node_modules\which\which.js:89:16

    npm ERR! gyp verb which failed at C:\公司项目文件夹\工具\HBuilderX.3.8.4.20230531\HBuilderX\plugins\compile-node-sass\node_modules\isexe\index.js:42:5

    npm ERR! gyp verb which failed at C:\公司项目文件夹\工具\HBuilderX.3.8.4.20230531\HBuilderX\plugins\compile-node-sass\node_modules\isexe\windows.js:36:5

    npm ERR! gyp verb which failed at FSReqCallback.oncomplete (node:fs:202:21)

    npm ERR! gyp verb which failed python Error: not found: python

    npm ERR! gyp verb which failed at getNotFoundError (C:\公司项目文件夹\工具\HBuilderX.3.8.4.20230531\HBuilderX\plugins\compile-node-sass\node_modules\which\which.js:13:12)

    npm ERR! gyp verb which failed at F (C:\公司项目文件夹\工具\HBuilderX.3.8.4.20230531\HBuilderX\plugins\compile-node-sass\node_modules\which\which.js:68:19)

    npm ERR! gyp verb which failed at E (C:\公司项目文件夹\工具\HBuilderX.3.8.4.20230531\HBuilderX\plugins\compile-node-sass\node_modules\which\which.js:80:29)

    npm ERR! gyp verb which failed at C:\公司项目文件夹\工具\HBuilderX.3.8.4.20230531\HBuilderX\plugins\compile-node-sass\node_modules\which\which.js:89:16

    npm ERR! gyp verb which failed at C:\公司项目文件夹\工具\HBuilderX.3.8.4.20230531\HBuilderX\plugins\compile-node-sass\node_modules\isexe\index.js:42:5

    npm ERR! gyp verb which failed at C:\公司项目文件夹\工具\HBuilderX.3.8.4.20230531\HBuilderX\plugins\compile-node-sass\node_modules\isexe\windows.js:36:5

    npm ERR! gyp verb which failed at FSReqCallback.oncomplete (node:fs:202:21) {

    npm ERR! gyp verb which failed code: 'ENOENT'

    npm ERR! gyp verb which failed }

    npm ERR! gyp verb could not find "python". checking python launcher

    npm ERR! gyp verb could not find "python". guessing location

    npm ERR! gyp verb ensuring that file exists: C:\Python27\python.exe

    npm ERR! gyp ERR! configure error

    npm ERR! gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.

    npm ERR! gyp ERR! stack at PythonFinder.failNoPython (C:\公司项目文件夹\工具\HBuilderX.3.8.4.20230531\HBuilderX\plugins\compile-node-sass\node_modules\node-gyp\lib\configure.js:484:19)

    npm ERR! gyp ERR! stack at PythonFinder.<anonymous> (C:\公司项目文件夹\工具\HBuilderX.3.8.4.20230531\HBuilderX\plugins\compile-node-sass\node_modules\node-gyp\lib\configure.js:509:16)

    npm ERR! gyp ERR! stack at C:\公司项目文件夹\工具\HBuilderX.3.8.4.20230531\HBuilderX\plugins\compile-node-sass\node_modules\graceful-fs\polyfills.js:282:31

    npm ERR! gyp ERR! stack at FSReqCallback.oncomplete (node:fs:202:21)

    npm ERR! gyp ERR! System Windows_NT 10.0.22000

    npm ERR! gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\公司项目文件夹\工具\HBuilderX.3.8.4.20230531\HBuilderX\plugins\compile-node-sass\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="

    npm ERR! gyp ERR! cwd C:\公司项目文件夹\工具\HBuilderX.3.8.4.20230531\HBuilderX\plugins\compile-node-sass\node_modules\node-sass-china

    npm ERR! gyp ERR! node -v v16.20.0

    npm ERR! gyp ERR! node-gyp -v v3.8.0

    npm ERR! gyp ERR! not ok

    npm ERR! Build failed with error code: 1


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

    npm ERR! C:\Users\lezhan01\AppData\Local\npm-cache_logs\2023-06-25T09_47_23_748Z-debug-0.log


    C:\公司项目文件夹\工具\HBuilderX.3.8.4.20230531\HBuilderX\plugins\compile-node-sass>

    2023-06-25 17:49

  • 3***@qq.com

    我按照这个方式,直接npm install报错

    2023-06-25 17:49

该问题目前已经被锁定, 无法添加新回复