adobe / aem-project-archetype

Maven template to create best-practice websites on AEM.
https://experienceleague.adobe.com/docs/experience-manager-core-components/using/developing/archetype/overview.html
Apache License 2.0
544 stars 419 forks source link

Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 10.x #472

Closed garghd closed 4 years ago

garghd commented 4 years ago

I have created a new maven project using https://github.com/adobe/aem-project-archetype/tags version 23. I see no issues when running mvn clean install -PautoInstallSinglePackage or mvn clean install in my local environment to deploy to AEM SDK.

However, I see the following error when I try to build and deploy the code to the AEM as a cloud service via cloud manager.

6:41:05,492 [Exec Stream Pumper] [INFO] 06:41:05,492 [Exec Stream Pumper] [INFO] > aem-maven-archetype@1.0.0 prod /build_root/build/apacsandboxprogram-/ui.frontend 06:41:05,492 [Exec Stream Pumper] [INFO] > webpack -p --config ./webpack.prod.js && clientlib --verbose 06:41:05,492 [Exec Stream Pumper] [INFO] 06:41:10,148 [Exec Stream Pumper] [INFO] Hash: 8a89df343722020b5230 06:41:10,148 [Exec Stream Pumper] [INFO] Version: webpack 4.44.1 06:41:10,148 [Exec Stream Pumper] [INFO] Time: 3504ms 06:41:10,149 [Exec Stream Pumper] [INFO] Built at: 08/26/2020 6:41:10 AM 06:41:10,149 [Exec Stream Pumper] [INFO] 1 asset 06:41:10,149 [Exec Stream Pumper] [INFO] Entrypoint site = clientlib-site/site.js 06:41:10,149 [Exec Stream Pumper] [INFO] 06:41:10,149 [Exec Stream Pumper] [INFO] WARNING in ./src/main/webpack/site/main.ts 06:41:10,149 [Exec Stream Pumper] [INFO] Module Warning (from (webpack)-import-glob-loader/index.js): 06:41:10,150 [Exec Stream Pumper] [INFO] (Emitted value instead of an instance of Error) Empty results for "import ".//*.js"" 06:41:10,150 [Exec Stream Pumper] [INFO] NonErrorEmittedError: (Emitted value instead of an instance of Error) Empty results for "import "./*/.js"" 06:41:10,150 [Exec Stream Pumper] [INFO] at Object.emitWarning (/build_root/build/apacsandboxprogram-/ui.frontend/node_modules/webpack/lib/NormalModule.js:160:16) 06:41:10,151 [Exec Stream Pumper] [INFO] at replacer (/build_root/build/apacsandboxprogram-/ui.frontend/node_modules/webpack-import-glob-loader/index.js:85:12) 06:41:10,151 [Exec Stream Pumper] [INFO] at String.replace () 06:41:10,151 [Exec Stream Pumper] [INFO] at Object.module.exports (/build_root/build/apacsandboxprogram-/ui.frontend/node_modules/webpack-import-glob-loader/index.js:91:20) 06:41:10,152 [Exec Stream Pumper] [INFO] 06:41:10,152 [Exec Stream Pumper] [INFO] ERROR in ./src/main/webpack/site/main.scss 06:41:10,152 [Exec Stream Pumper] [INFO] Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js): 06:41:10,152 [Exec Stream Pumper] [INFO] ModuleBuildError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js): 06:41:10,153 [Exec Stream Pumper] [INFO] Error: Missing binding /build_root/build/apacsandboxprogram-/ui.frontend/node_modules/node-sass/vendor/linux-x64-64/binding.node 06:41:10,153 [Exec Stream Pumper] [INFO] Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 10.x 06:41:10,153 [Exec Stream Pumper] [INFO] 06:41:10,153 [Exec Stream Pumper] [INFO] Found bindings for the following environments: 06:41:10,153 [Exec Stream Pumper] [INFO] - OS X 64-bit with Node.js 10.x 06:41:10,154 [Exec Stream Pumper] [INFO] 06:41:10,154 [Exec Stream Pumper] [INFO] This usually happens because your environment has changed since running npm install. 06:41:10,154 [Exec Stream Pumper] [INFO] Run npm rebuild node-sass to download the binding for your current environment.** 06:41:10,154 [Exec Stream Pumper] [INFO] at module.exports (/build_root/build/apacsandboxprogram-/ui.frontend/node_modules/node-sass/lib/binding.js:15:13) 06:41:10,155 [Exec Stream Pumper] [INFO] at Object. (/build_root/build/apacsandboxprogram-/ui.frontend/node_modules/node-sass/lib/index.js:14:35) 06:41:10,155 [Exec Stream Pumper] [INFO] at Module._compile (/build_root/build/apacsandboxprogram-/ui.frontend/node_modules/v8-compile-cache/v8-compile-cache.js:194:30) 06:41:10,156 [Exec Stream Pumper] [INFO] at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10) 06:41:10,156 [Exec Stream Pumper] [INFO] at Module.load (internal/modules/cjs/loader.js:598:32) 06:41:10,156 [Exec Stream Pumper] [INFO] at tryModuleLoad (internal/modules/cjs/loader.js:537:12) 06:41:10,156 [Exec Stream Pumper] [INFO] at Function.Module._load (internal/modules/cjs/loader.js:529:3) 06:41:10,156 [Exec Stream Pumper] [INFO] at Module.require (internal/modules/cjs/loader.js:636:17) 06:41:10,157 [Exec Stream Pumper] [INFO] at require (/build_root/build/apacsandboxprogram-/ui.frontend/node_modules/v8-compile-cache/v8-compile-cache.js:161:20) 06:41:10,157 [Exec Stream Pumper] [INFO] at getDefaultSassImpl (/build_root/build/apacsandboxprogram-/ui.frontend/node_modules/sass-loader/dist/index.js:198:10) 06:41:10,158 [Exec Stream Pumper] [INFO] at Object.loader (/build_root/build/apacsandboxprogram-/ui.frontend/node_modules/sass-loader/dist/index.js:80:29) 06:41:10,158 [Exec Stream Pumper] [INFO] at runLoaders (/build_root/build/apacsandboxprogram-/ui.frontend/node_modules/webpack/lib/NormalModule.js:316:20) 06:41:10,158 [Exec Stream Pumper] [INFO] at /build_root/build/apacsandboxprogram-/ui.frontend/node_modules/loader-runner/lib/LoaderRunner.js:367:11 06:41:10,159 [Exec Stream Pumper] [INFO] at /build_root/build/apacsandboxprogram-/ui.frontend/node_modules/loader-runner/lib/LoaderRunner.js:233:18 06:41:10,159 [Exec Stream Pumper] [INFO] at runSyncOrAsync (/build_root/build/apacsandboxprogram-/ui.frontend/node_modules/loader-runner/lib/LoaderRunner.js:143:3) 06:41:10,160 [Exec Stream Pumper] [INFO] at iterateNormalLoaders (/build_root/build/apacsandboxprogram-/ui.frontend/node_modules/loader-runner/lib/LoaderRunner.js:232:2) 06:41:10,160 [Exec Stream Pumper] [INFO] at iterateNormalLoaders (/build_root/build/apacsandboxprogram-/ui.frontend/node_modules/loader-runner/lib/LoaderRunner.js:221:10) 06:41:10,160 [Exec Stream Pumper] [INFO] at /build_root/build/apacsandboxprogram-/ui.frontend/node_modules/loader-runner/lib/LoaderRunner.js:236:3 06:41:10,161 [Exec Stream Pumper] [INFO] at runSyncOrAsync (/build_root/build/apacsandboxprogram-/ui.frontend/node_modules/loader-runner/lib/LoaderRunner.js:130:11) 06:41:10,161 [Exec Stream Pumper] [INFO] at iterateNormalLoaders (/build_root/build/apacsandboxprogram-/ui.frontend/node_modules/loader-runner/lib/LoaderRunner.js:232:2) 06:41:10,162 [Exec Stream Pumper] [INFO] at Array. (/build_root/build/apacsandboxprogram-/ui.frontend/node_modules/loader-runner/lib/LoaderRunner.js:205:4) 06:41:10,162 [Exec Stream Pumper] [INFO] at Storage.finished (/build_root/build/apacsandboxprogram-/ui.frontend/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16) 06:41:10,163 [Exec Stream Pumper] [INFO] at provider (/build_root/build/apacsandboxprogram-/ui.frontend/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9) 06:41:10,163 [Exec Stream Pumper] [INFO] at /build_root/build/apacsandboxprogram-/ui.frontend/node_modules/graceful-fs/graceful-fs.js:123:16 06:41:10,163 [Exec Stream Pumper] [INFO] at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3) 06:41:10,164 [Exec Stream Pumper] [INFO] @ ./src/main/webpack/site/main.ts 1:0-21 06:41:10,246 [Exec Stream Pumper] [ERROR] npm ERR! code ELIFECYCLE 06:41:10,247 [Exec Stream Pumper] [ERROR] npm ERR! errno 2 06:41:10,248 [Exec Stream Pumper] [ERROR] npm ERR! aem-maven-archetype@1.0.0 prod: webpack -p --config ./webpack.prod.js && clientlib --verbose 06:41:10,248 [Exec Stream Pumper] [ERROR] npm ERR! Exit status 2 06:41:10,248 [Exec Stream Pumper] [ERROR] npm ERR! 06:41:10,248 [Exec Stream Pumper] [ERROR] npm ERR! Failed at the aem-maven-archetype@1.0.0 prod script. 06:41:10,248 [Exec Stream Pumper] [ERROR] npm ERR! This is probably not a problem with npm. There is likely additional logging output above. 06:41:10,320 [Exec Stream Pumper] [ERROR] 06:41:10,320 [Exec Stream Pumper] [ERROR] npm ERR! A complete log of this run can be found in: 06:41:10,320 [Exec Stream Pumper] [ERROR] npm ERR! /root/.npm/_logs/2020-08-26T06_41_10_249Z-debug.log 06:41:10,325 [main] [INFO] ------------------------------------------------------------------------ 06:41:10,325 [main] [INFO] Reactor Summary for -aacs-base 1.0-SNAPSHOT: 06:41:10,325 [main] [INFO]

Platform and Version

AEM RELEASE:2020.5.3190.20200506T112924Z

msagolj commented 4 years ago

Hi @garghd unless I'm mistaken the answer is in the bold part of the error you pasted:

06:41:10,153 [Exec Stream Pumper] [INFO] Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 10.x
06:41:10,153 [Exec Stream Pumper] [INFO] Found bindings for the following environments:
06:41:10,153 [Exec Stream Pumper] [INFO] - OS X 64-bit with Node.js 10.x
06:41:10,154 [Exec Stream Pumper] [INFO] Run npm rebuild node-sass to download the binding for your current environment.

have you tried running npm rebuild node-sass on the linux environment?

msagolj commented 4 years ago

Closing for now, please reopen if needed.

kavinmehta-work commented 4 years ago

I have seen this multiple times, its an issue with node-sass and the latest node version. What has worked for me is to delete the node-sass folder in node_modules and do npm install again.

godanny86 commented 4 years ago

hi @KavinMehta-CNB I have seen this issue as well. When developing locally I find that if the version of NPM/Node you have installed locally does not match the versions specified in the project you can run into this issue. npm rebuild node-sass works, as well as what you mentioned removing the node_modules folder.

As for the Cloud Manager deployment, double-check to make sure the node, node_modules and package-lock.json are not committed to the git repository used for deploying to Cloud Manager.

garghd commented 4 years ago

Thank you @godanny86! I can confirm that after deleting following files the issue is fixed.

  1. node
  2. node_modules
  3. package-lock.json