Hey!
I'm trying to get my Ruby on Rails app up and running but keep getting
`core-js: Command failed` and `node-sass: Command failed`:
I see a lot of other people having the same problem, so with you guys' help,
I'd love to pass on a solution to them as well.
Thank you!
-P
--
Sometimes I get:
[4/4] Building fresh packages...
[1/3] ⠂ node-sass
[2/3] ⠂ core-js
error /home/dev/myapp/node_modules/node-sass: Command failed.
Exit code: 127
Command: node scripts/install.js
Arguments:
Directory: /home/dev/myapp/node_modules/node-sass
Output:
/tmp/yarn--1588753582434-0.8689804385745683/node[3]:
/tmp/yarn--1588753582434-0.8689804385745683/../node: not found
And other times:
[1/3] ⠂ node-sass
[2/3] ⠂ core-js
error /home/apps/myapp/node_modules/core-js: Command failed.
Exit code: 127
Command: node -e "try{require('./postinstall')}catch(e){}"
Arguments:
Directory: /home/apps/myapp/node_modules/core-js
Output:
/tmp/yarn--1606496272135-0.38725164541825685/node[3]:
/tmp/yarn--1606496272135-0.38725164541825685/../node: not found
What's extra confusing is that there are duplicate builds, ie.
node_modules/core-js and node_modules/@rails/webpacker/node_modules/core-js.
I've tried removing a few suspicious lines like core-js/package.json#L55 [1]
and node-sass/scripts/install.js#L157 [2] and then rebuilding and reinstalling
locally [3] but to no avail. I've also tried installing /usr/ports/www/libsass.
% cat /etc/zprofile
export CC=/usr/bin/clang
export CXX=/usr/bin/clang++
% yarn list | grep node-sass
│ ├─ [email protected]
│ ├─ node-sass@file:node-sass-4.13.1.tgz
├─ [email protected]
% yarn list | grep core-js
│ ├─ core-js-compat@^3.6.2
│ ├─ [email protected]
│ ├─ core-js@file:core-js-3.6.4.tgz
├─ [email protected]
├─ [email protected]
% npm -v
6.13.4
% node -v
v12.16.1
% yarn -v
1.22.4
% rails -v
Rails 6.0.3.4
% ruby -v
ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-openbsd]
% uname -r
6.8
[1]
https://github.com/zloirock/core-js/blob/master/packages/core-js/package.json#L55
[2] https://github.com/sass/node-sass/blob/master/scripts/install.js#L157
[3]
https://stackoverflow.com/questions/55560791/build-and-use-npm-package-locally