首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法预编译-assets

无法预编译-assets
EN

Stack Overflow用户
提问于 2021-02-03 11:50:17
回答 1查看 90关注 0票数 2

我正在尝试预编译资源,但得到了一个相当模糊的错误。我认为这可能是node-sass的问题,这导致我尝试通过Yarn安装,但也失败了,并出现了一个不太有用的错误。任何帮助都将不胜感激。

预编译资产似乎在以下方面出现了问题:

代码语言:javascript
复制
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/path/to/example.com/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (node:events:376:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:277:12)
gyp ERR! System Linux 2.6.32-042stab120.19
gyp ERR! command "/root/.nvm/versions/node/v15.3.0/bin/node" "/path/to/example.com/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /path/to/example.com/node_modules/node-sass
gyp ERR! node -v v15.3.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
Build failed with error code: 1

Full Output of: RAILS_ENV=production rails assets:precompile

将node-sass添加为via yarn具有类似的输出:

代码语言:javascript
复制
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (path/to/example.com/node_modules/@rails/webpacker/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (node:events:376:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:277:12)
gyp ERR! System Linux 2.6.32-042stab120.19
gyp ERR! command "/root/.nvm/versions/node/v15.3.0/bin/node" "path/to/example.com/node_modules/@rails/webpacker/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd path/to/example.com/node_modules/@rails/webpacker/node_modules/node-sass
gyp ERR! node -v v15.3.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 

Full Output of: yarn add node-sass

EN

回答 1

Stack Overflow用户

发布于 2021-02-04 12:12:12

您似乎正在尝试在节点15上安装较旧版本的node-sass。节点15仅在node-sass v5 https://github.com/sass/node-sass#node-version-support-policy上受支持

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66021000

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档