I get node-sass errors when building the Accelerator clients (the Email client or the MVC client) no matter how I try to do it.
The error is in the yarn pipeline somewhere:
error C:\Users\…\Src\Litium.Accelerator.Email\node_modules\node-sass: Command failed.
Exit code: 1
Command: node scripts/build.js
The actual error is this:
gyp ERR! stack Error: Command failed: C:\Python39\python.EXE -c import sys; print “%s.%s.%s” % sys.version_info[:3];
gyp ERR! stack File “”, line 1
gyp ERR! stack import sys; print “%s.%s.%s” % sys.version_info[:3];
gyp ERR! stack ^
gyp ERR! stack SyntaxError: invalid syntax
I’ve tried both running BuildClientProjects
and running yarn
directly in the MVC/Email project directories.
From some web searching, this seems like a version mismatch between node, yarn, npm, python and/or node-sass.
What are the actual steps to get a working BuildClientProjects
?
Install Visual Studio. Does it matter which workloads?
Install node? Or should we use the node/npm stuff included in Visual Studio?
Install yarn? Via npm? Or via the installer?
Something else?
The Accelerator installation instructions are a bit vague and link to an old version of yarn.
Litium version: 7.latest
Python 3.latest was installed with Node. After downgrading to Python 2.latest, I get this error instead:
ERROR in ./Styles/site.scss
Module build failed (from …/node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from …/node_modules/sass-loader/lib/loader.js):
Error: Node Sass does not yet support your current environment: Windows 32-bit with Unsupported runtime (83)
The documentation page for a specific add-on says to npm rebuild node-sass
if there are problems with yarn, but running that gives this error:
gyp ERR! UNCAUGHT EXCEPTION
gyp ERR! stack Error: spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\15.0\Bin\MSBuild.exe ENOENT
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
gyp ERR! stack at onErrorNT (internal/child_process.js:467:16)
gyp ERR! stack at processTicksAndRejections (internal/process/task_queues.js:82:21)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command “C:\Program Files (x86)\nodejs\node.exe” “C:\Users\…\Src\Litium.Accelerator.Mvc\node_modules\node-gyp\bin\node-gyp.js” “rebuild” “–verbose” “–libsass_ext=” “–libsass_cflags=” “–libsass_ldflags=” “–libsass_library=”
gyp ERR! cwd C:\Users.…\Src\Litium.Accelerator.Mvc\node_modules\node-sass
gyp ERR! node -v v14.17.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! This is a bug in node-gyp
.
It looks like the path to MSBuild.exe
is incorrect.
Remove node_modules folder and use yarn to install and rebuild the node-sass if necessary and try to build again.
NilsN
May 19, 2021, 7:53am
5
Also make sure that node-sass supports the version of node you have installed. I believe the Accelerator uses node-sass 4.x which supports up to node 13.
1 Like
hans
June 3, 2021, 4:31pm
6
Are there any plans to upgrade or support more recent versions of Node.js?
Bug is created to upgrade. In later version (Litium 8) we have updated to use the sass compiler instead and most probably the same change are compatible with the Litium 7 version of accelerator also.
1 Like
system
Closed
July 13, 2021, 6:26am
8
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.