Found bindings for the following environments: Linux 64-bit with Node.js 10.x

207 views Asked by At

I am trying to run specific command for OroCRM

bin/console oro:assets:install
bin/console oro:assets:build

Both throw the same. Most relevant part is below

Installing npm dependencies.
/usr/bin/npm
--no-audit
install
Done.
Building assets.
'/usr/bin/node' 'vendor/oro/platform/build//node_modules/webpack/bin/webpack.js' '--hide-modules' '--mode=production' '--env.stats=' '--env.symfony=dev' '--colors'
Happy[babel]: Version: 5.0.1. Threads: 3
Happy[babel]: All set; signaling webpack to proceed.
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
Child
    Time: [1m34192[39m[22mms
     32 assets
    
    [1m[31mERROR in ./bundles/npmassets/timepicker/jquery.timepicker.css
    Module build failed (from ../vendor/oro/platform/build/node_modules/mini-css-extract-plugin/dist/loader.js):
    ModuleBuildError: Module build failed (from ../vendor/oro/platform/build/node_modules/sass-loader/lib/loader.js):
    Error: Missing binding /data/web/application/vendor/oro/platform/build/node_modules/node-sass/vendor/linux-x64-83/binding.node
    Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 14.x
    
    Found bindings for the following environments:
      - Linux 64-bit with Node.js 10.x
    
    This usually happens because your environment has changed since running `npm install`.
    Run `npm rebuild node-sass` to download the binding for your current environment.

From what I understand, the Node version is not correct. I tried every Node version from 10 up to 15 without any luck.

I also tried npm rebuild node-sass as suggested. Same results still.

There might be a mix up in the executables uses.

app@2b2af7e8e5fd:~/application$ which npm
/data/web/.nvm/versions/node/v12.22.12/bin/npm

And

app@2b2af7e8e5fd:~/application$ which node
/data/web/.nvm/versions/node/v12.22.12/bin/node

When I check the output of the command, I see the following. So I suspect something is bing mixed up with the versions.

Installing npm dependencies.
/usr/bin/npm
--no-audit
install

I already tried symlinking my updated versions in /data/web/.nvm to /usr/bin/npm without any luck. Same error message.

How can I fix this?

1

There are 1 answers

0
Andrey Yatsenko On

After switch of node js version it is required to delete node_modules and the application cache.

You can do it by running rm -rf node_modules/ var/cache/* in the application root folder.

You can find in the documentation which version of NodeJS is compatible with your version of OroCRM: https://doc.oroinc.com/backend/setup/system-requirements/. And to know which application version you are using follow this guide https://doc.oroinc.com/user/back-office/system/system-information/#system-information