Error: Module did not self-register
1、错误描述
[编译scss/sass] 14:56:38.373 internal/modules/cjs/loader.js:717
[编译scss/sass] 14:56:38.373 return process.dlopen(module, path.toNamespacedPath(filename));
[编译scss/sass] 14:56:38.373 ^
[编译scss/sass] 14:56:38.373 Error: Module did not self-register.
[编译scss/sass] 14:56:38.373 at Object.Module._extensions..node (internal/modules/cjs/loader.js:717:18)
[编译scss/sass] 14:56:38.373 at Module.load (internal/modules/cjs/loader.js:598:32)
[编译scss/sass] 14:56:38.373 at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
[编译scss/sass] 14:56:38.373 at Function.Module._load (internal/modules/cjs/loader.js:529:3)
[编译scss/sass] 14:56:38.373 at Module.require (internal/modules/cjs/loader.js:636:17)
[编译scss/sass] 14:56:38.373 at require (internal/modules/cjs/helpers.js:20:18)
[编译scss/sass] 14:56:38.373 at module.exports (G:\HBuilderX\plugins\compile-node-sass\node_modules\node-sass-china\lib\binding.js:19:10)
[编译scss/sass] 14:56:38.373 at Object.<anonymous> (G:\HBuilderX\plugins\compile-node-sass\node_modules\node-sass-china\lib\index.js:14:35)
[编译scss/sass] 14:56:38.373 at Module._compile (internal/modules/cjs/loader.js:688:30)
[编译scss/sass] 14:56:38.373 at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
2、错误原因
错误提示是模块没有注册,使用npm Install安装,结果还是报错,说明模块没有安装成功
G:\HBuilderX\plugins\compile-node-sass\node_modules\node-sass-china\vendor\win32
-x64-64>npm install
> node-sass-china@4.7.2 install G:\HBuilderX\plugins\compile-node-sass\node_modu
les\node-sass-china
> node scripts/install.js
node-sass build Binary found at G:\HBuilderX\plugins\compile-node-sass\node_modu
les\node-sass-china\vendor\win32-x64-64\binding.node
> node-sass-china@4.7.2 postinstall G:\HBuilderX\plugins\compile-node-sass\node_
modules\node-sass-china
> node scripts/build.js
Binary found at G:\HBuilderX\plugins\compile-node-sass\node_modules\node-sass-ch
ina\vendor\win32-x64-64\binding.node
Testing binary
Binary has a problem: Error: \\?\G:\HBuilderX\plugins\compile-node-sass\node_mod
ules\node-sass-china\vendor\win32-x64-64\binding.node is not a valid Win32 appli
cation.
\\?\G:\HBuilderX\plugins\compile-node-sass\node_modules\node-sass-china\vendor\w
in32-x64-64\binding.node
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 (G:\HBuilderX\plugins\compile-node-sass\node_modules\node-
sass-china\lib\binding.js:19:10)
at Object.<anonymous> (G:\HBuilderX\plugins\compile-node-sass\node_modules\n
ode-sass-china\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: F:\nodejs\node.exe G:\HBuilderX\plugins\compile-node-sass\node_modules
\node-sass-china\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsa
ss_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ 'F:\\nodejs\\node.exe',
gyp verb cli 'G:\\HBuilderX\\plugins\\compile-node-sass\\node_modules\\node-sa
ss-china\\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.13.0 | 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 (G:\HBuilderX\plugins\compile-no
de-sass\node_modules\node-sass-china\node_modules\which\which.js:13:12)
gyp verb `which` failed at F (G:\HBuilderX\plugins\compile-node-sass\node_mo
dules\node-sass-china\node_modules\which\which.js:68:19)
gyp verb `which` failed at E (G:\HBuilderX\plugins\compile-node-sass\node_mo
dules\node-sass-china\node_modules\which\which.js:80:29)
gyp verb `which` failed at G:\HBuilderX\plugins\compile-node-sass\node_modul
es\node-sass-china\node_modules\which\which.js:89:16
gyp verb `which` failed at G:\HBuilderX\plugins\compile-node-sass\node_modul
es\node-sass-china\node_modules\isexe\index.js:42:5
gyp verb `which` failed at G:\HBuilderX\plugins\compile-node-sass\node_modul
es\node-sass-china\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 (G:\HBuilderX\plugins\compile-no
de-sass\node_modules\node-sass-china\node_modules\which\which.js:13:12)
gyp verb `which` failed at F (G:\HBuilderX\plugins\compile-node-sass\node_mo
dules\node-sass-china\node_modules\which\which.js:68:19)
gyp verb `which` failed at E (G:\HBuilderX\plugins\compile-node-sass\node_mo
dules\node-sass-china\node_modules\which\which.js:80:29)
gyp verb `which` failed at G:\HBuilderX\plugins\compile-node-sass\node_modul
es\node-sass-china\node_modules\which\which.js:89:16
gyp verb `which` failed at G:\HBuilderX\plugins\compile-node-sass\node_modul
es\node-sass-china\node_modules\isexe\index.js:42:5
gyp verb `which` failed at G:\HBuilderX\plugins\compile-node-sass\node_modul
es\node-sass-china\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 (
G:\\HBuilderX\\plugins\\compile-node-sass\\node_modules\\node-sass-china\\node_m
odules\\which\\which.js:13:12)\n at F (G:\\HBuilderX\\plugins\\compile-node-s
ass\\node_modules\\node-sass-china\\node_modules\\which\\which.js:68:19)\n at
E (G:\\HBuilderX\\plugins\\compile-node-sass\\node_modules\\node-sass-china\\no
de_modules\\which\\which.js:80:29)\n at G:\\HBuilderX\\plugins\\compile-node-
sass\\node_modules\\node-sass-china\\node_modules\\which\\which.js:89:16\n at
G:\\HBuilderX\\plugins\\compile-node-sass\\node_modules\\node-sass-china\\node_
modules\\isexe\\index.js:42:5\n at G:\\HBuilderX\\plugins\\compile-node-sass\
\node_modules\\node-sass-china\\node_modules\\isexe\\windows.js:36:5\n at FSR
eqWrap.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 E:\Python\Python36\python.EXE
gyp ERR! configure error
gyp ERR! stack Error: Command failed: E:\Python\Python36\python.EXE -c import sy
s; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack File "<string>", line 1
gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack at ChildProcess.exithandler (child_process.js:289:12)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at maybeClose (internal/child_process.js:962:16)
gyp ERR! stack at Socket.stream.socket.on (internal/child_process.js:381:11)
gyp ERR! stack at Socket.emit (events.js:182:13)
gyp ERR! stack at Pipe._handle.close (net.js:606:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "F:\\nodejs\\node.exe" "G:\\HBuilderX\\plugins\\compile-node-sa
ss\\node_modules\\node-sass-china\\node_modules\\node-gyp\\bin\\node-gyp.js" "re
build" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--
libsass_library="
gyp ERR! cwd G:\HBuilderX\plugins\compile-node-sass\node_modules\node-sass-china
gyp ERR! node -v v10.13.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass-china@4.7.2 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass-china@4.7.2 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! F:\nodejs\node_cache\_logs\2019-01-10T07_40_54_700Z-debug.log
G:\HBuilderX\plugins\compile-node-sass\node_modules\node-sass-china\vendor\win32
-x64-64>
3、解决办法
将Sass相关的模块卸载后重装
C:\Users\Administrator.USER-0GUONPPBHK>npm uninstall node-sass -D
npm WARN Administrator.USER-0GUONPPBHK No repository field.
npm WARN Administrator.USER-0GUONPPBHK No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fse
vents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}
)
added 33 packages from 16 contributors, removed 22 packages and updated 340 pack
ages in 26.067s
C:\Users\Administrator.USER-0GUONPPBHK>npm install node-sass -D
> node-sass@4.11.0 install C:\Users\Administrator.USER-0GUONPPBHK\node_modules\n
ode-sass
> node scripts/install.js
Cached binary found at F:\nodejs\node_cache\node-sass\4.11.0\win32-x64-64_bindin
g.node
> node-sass@4.11.0 postinstall C:\Users\Administrator.USER-0GUONPPBHK\node_modul
es\node-sass
> node scripts/build.js
Binary found at C:\Users\Administrator.USER-0GUONPPBHK\node_modules\node-sass\ve
ndor\win32-x64-64\binding.node
Testing binary
Binary is fine
npm WARN element-ui@2.4.3 requires a peer of vue@^2.5.2 but none is installed. Y
ou must install peer dependencies yourself.
npm WARN muse-ui@3.0.0-rc.7 requires a peer of vue@^2.5.0 but none is installed.
You must install peer dependencies yourself.
npm WARN Administrator.USER-0GUONPPBHK No repository field.
npm WARN Administrator.USER-0GUONPPBHK No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fse
vents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}
)
+ node-sass@4.11.0
added 110 packages from 118 contributors in 26.774s
C:\Users\Administrator.USER-0GUONPPBHK>
还没有评论,来说两句吧...