mercredi 28 juillet 2021

Problem with Node-sass in legacy project with Ember

I have a legacy project in ember and when trying to run npm i it gives the following errors:

> node-sass@3.13.1 install 
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v3.13.1/win32-x64-72_bind
Cannot download "https://github.com/sass/node-sass/releases/download/v3.13.1/win32-x64-72_binding.nod

HTTP error 404 Not Found

Hint: If github.com is not accessible in your location
      try setting a proxy via HTTP_PROXY, e.g.

      export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

      npm config set proxy http://example.com:8080

> phantomjs-prebuilt@2.1.16 install
> node install.js

PhantomJS not found on PATH
Download already available at C:\Users\\AppData\Local\Temp\phantomjs\phantomjs-2.1.1-windows.z
Verified checksum of previously downloaded file
Extracting zip contents
Removing phantomjs-prebuilt\li
Copying extracted folder AppData\Local\Temp\phantomjs\phantomjs-2.1.1-windows.zip-exhantomjs-2.1.1-windows -> node_modules\phanantom
Writing location.js file
Done. Phantomjs binary available at node_moilt\lib\phantom\bin\phantomjs.exe

> core-js@2.6.12 postinstall node_modules\bdules\core-js
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standa

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)


> core-js@2.6.12 postinstall node_modules\bdules\core-js
> node -e "try{require('./postinstall')}catch(e){}"


> core-js@2.6.12 postinstall node_modules\bules\core-js
> node -e "try{require('./postinstall')}catch(e){}"


> node-sass@3.13.1 postinstall node_modules
> node scripts/build.js

Building: C:\Program Files\nodejs\node.exe \\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_libr
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli   'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli   'C:\\Users\\\\Documents\\PROJETOS\\\\node_modules\\node-gygyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library='
gyp verb cli ]
gyp info using node-gyp@3.8.0
gyp info using node@12.14.1 | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed     at getNotFoundError (C:\Users\\Documents\PROJETOS\RedeCotizadorFroich\which.js:13:12)
gyp verb `which` failed     at F (C:\Users\\Documents\PROJETOS\\node_modu:19)
gyp verb `which` failed     at E (C:\Users\\Documents\PROJETOS\\node_modu:29)
gyp verb `which` failed     at C:\Users\\Documents\PROJETOS\\node_modulesgyp verb `which` failed     at C:\Users\\Documents\PROJETOS\\node_modules
gyp verb `which` failed     at C:\Users\\Documents\PROJETOS\\node_modules5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:158:21)
gyp verb `which` failed  python2 Error: not found: python2
gyp verb `which` failed     at getNotFoundError (C:\Users\\Documents\PROJETOS\RedeCotizadorFroich\which.js:13:12)
gyp verb `which` failed     at F (C:\Users\\Documents\PROJETOS\\node_modu:19)
gyp verb `which` failed     at E (C:\Users\\Documents\PROJETOS\\node_modu:29)
gyp verb `which` failed     at C:\Users\\Documents\PROJETOS\\node_modulesgyp verb `which` failed     at C:\Users\\Documents\PROJETOS\\node_modules
gyp verb `which` failed     at C:\Users\\Documents\PROJETOS\\node_modules5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:158:21) {
gyp verb `which` failed   stack: 'Error: not found: python2\n' +
gyp verb `which` failed     '    at getNotFoundError (C:\\Users\\\\Documents\\PROJETOS\\RedeCo_modules\\which\\which.js:13:12)\n' +
gyp verb `which` failed     '    at F (C:\\Users\\\\Documents\\PROJETOS\\\\which.js:68:19)\n' +
gyp verb `which` failed     '    at E (C:\\Users\\\\Documents\\PROJETOS\\\\which.js:80:29)\n' +
gyp verb `which` failed     '    at C:\\Users\\\\Documents\\PROJETOS\\\\nhich.js:89:16\n' +
gyp verb `which` failed     '    at C:\\Users\\\\Documents\\PROJETOS\\\\nndex.js:42:5\n' +
gyp verb `which` failed     '    at C:\\Users\\\\Documents\\PROJETOS\\\\nindows.js:36:5\n' +
gyp verb `which` failed     '    at FSReqCallback.oncomplete (fs.js:158:21)',
gyp verb `which` failed   code: 'ENOENT'
gyp verb `which` failed }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` failed Error: not found: python
gyp verb `which` failed     at getNotFoundError (C:\Users\\Documents\PROJETOS\RedeCotizadorFroich\which.js:13:12)
gyp verb `which` failed     at F (C:\Users\\Documents\PROJETOS\\node_modu:19)
gyp verb `which` failed     at E (C:\Users\\Documents\PROJETOS\\node_modu:29)
gyp verb `which` failed     at C:\Users\\Documents\PROJETOS\\node_modulesgyp verb `which` failed     at C:\Users\\Documents\PROJETOS\\node_modules
gyp verb `which` failed     at C:\Users\\Documents\PROJETOS\\node_modules5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:158:21)
gyp verb `which` failed  python Error: not found: python
gyp verb `which` failed     at getNotFoundError (C:\Users\\Documents\PROJETOS\RedeCotizadorFroich\which.js:13:12)
gyp verb `which` failed     at F (C:\Users\\Documents\PROJETOS\\node_modu:19)
gyp verb `which` failed     at E (C:\Users\\Documents\PROJETOS\\node_modu:29)
gyp verb `which` failed     at C:\Users\\Documents\PROJETOS\\node_modulesgyp verb `which` failed     at C:\Users\\Documents\PROJETOS\\node_modules
gyp verb `which` failed     at C:\Users\\Documents\PROJETOS\\node_modules5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:158:21) {
gyp verb `which` failed   stack: 'Error: not found: python\n' +
gyp verb `which` failed     '    at getNotFoundError (C:\\Users\\\\Documents\\PROJETOS\\RedeCo_modules\\which\\which.js:13:12)\n' +
gyp verb `which` failed     '    at F (C:\\Users\\\\Documents\\PROJETOS\\\\which.js:68:19)\n' +
gyp verb `which` failed     '    at E (C:\\Users\\\\Documents\\PROJETOS\\\\which.js:80:29)\n' +
gyp verb `which` failed     '    at C:\\Users\\\\Documents\\PROJETOS\\\\nhich.js:89:16\n' +
gyp verb `which` failed     '    at C:\\Users\\\\Documents\\PROJETOS\\\\nndex.js:42:5\n' +
gyp verb `which` failed     '    at C:\\Users\\\\Documents\\PROJETOS\\\\nindows.js:36:5\n' +
gyp verb `which` failed     '    at FSReqCallback.oncomplete (fs.js:158:21)',
gyp verb `which` failed   code: 'ENOENT'
gyp verb `which` failed }
gyp verb could not find "python". checking python launcher
gyp verb could not find "python". guessing location 
gyp verb ensuring that file exists: C:\Python27\python.exe
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (C:\Users\\Documents\PROJETOS\RedeCotizadorFrode-gyp\lib\configure.js:484:19)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Users\\Documents\PROJETOS\RedeCotizadorFrone-gyp\lib\configure.js:509:16)
gyp ERR! stack     at callback (C:\Users\\Documents\PROJETOS\\node_modulels.js:299:20)
gyp ERR! stack     at FSReqCallback.oncomplete (fs.js:158:21)
gyp ERR! System Windows_NT 10.0.19042
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\\\Documents\\PROJETOS\\RededorFrontEnd\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libslags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\\Documents\PROJETOS\\node_modules\node-sass
gyp ERR! node -v v12.14.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN babel-plugin-debug-macros@0.2.0 requires a peer of @babel/core@^7.0.0-beta.42 but none is ind. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
PS C:\Users\\Documents\PROJETOS\> npm install node-sass

> node-sass@6.0.1 install C:\Users\\Documents\PROJETOS\\node_modules\node
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v6.0.1/win32-x64-72_bindie
Download complete .] - :
Binary saved to C:\Users\\Documents\PROJETOS\\node_modules\node-sass\vend32-x64-72\binding.node
Caching binary to C:\Users\\AppData\Roaming\npm-cache\node-sass\6.0.1\win32-x64-72_binding.nod

> node-sass@6.0.1 postinstall C:\Users\\Documents\PROJETOS\\node_modules\ass
> node scripts/build.js

Binary found at C:\Users\\Documents\PROJETOS\\node_modules\node-sass\vend32-x64-72\binding.node
Testing binary
PS C:\Users\\Documents\PROJETOS\> npm i

> node-sass@3.13.1 install C:\Users\\Documents\PROJETOS\\node_modules\brosass-source-maps\node_modules\node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v3.13.1/win32-x64-72_bindde
Cannot download "https://github.com/sass/node-sass/releases/download/v3.13.1/win32-x64-72_binding.nod

HTTP error 404 Not Found

Hint: If github.com is not accessible in your location
      try setting a proxy via HTTP_PROXY, e.g.

      export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

      npm config set proxy http://example.com:8080

> phantomjs-prebuilt@2.1.16 install C:\Users\\Documents\PROJETOS\\node_mophantomjs-prebuilt
> node install.js

PhantomJS not found on PATH
Download already available at C:\Users\\AppData\Local\Temp\phantomjs\phantomjs-2.1.1-windows.z
Verified checksum of previously downloaded file
Extracting zip contents
Removing C:\Users\\Documents\PROJETOS\\node_modules\phantomjs-prebuilt\litom
Copying extracted folder C:\Users\\AppData\Local\Temp\phantomjs\phantomjs-2.1.1-windows.zip-ex1627499579693\phantomjs-2.1.1-windows -> C:\Users\\Documents\PROJETOS\\noules\phantomjs-prebuilt\lib\phantom
Writing location.js file
Done. Phantomjs binary available at C:\Users\\Documents\PROJETOS\\node_mophantomjs-prebuilt\lib\phantom\bin\phantomjs.exe

> core-js@2.6.12 postinstall C:\Users\\Documents\PROJETOS\\node_modules\bolyfill\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standarary!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)


> core-js@2.6.12 postinstall C:\Users\\Documents\PROJETOS\\node_modules\begister\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"


> core-js@2.6.12 postinstall C:\Users\\Documents\PROJETOS\\node_modules\buntime\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"


> node-sass@3.13.1 postinstall C:\Users\\Documents\PROJETOS\\node_modulesoli-sass-source-maps\node_modules\node-sass
> node scripts/build.js

Building: C:\Program Files\nodejs\node.exe C:\Users\\Documents\PROJETOS\\odules\broccoli-sass-source-maps\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_exibsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli   'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli   'C:\\Users\\\\Documents\\PROJETOS\\\\node_modules\\broccol-source-maps\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',      
gyp verb cli   '--libsass_ldflags=',     
gyp verb cli   '--libsass_library='      
gyp verb cli ]
gyp info using node-gyp@3.8.0
gyp info using node@12.14.1 | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed     at getNotFoundError (C:\Users\\Documents\PROJETOS\RedeCotizadorFronode_modules\broccoli-sass-source-maps\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\Users\\Documents\PROJETOS\\node_moduoccoli-sass-source-maps\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\Users\\Documents\PROJETOS\\node_moduoccoli-sass-source-maps\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\Users\\Documents\PROJETOS\\node_modulesoli-sass-source-maps\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\Users\\Documents\PROJETOS\\node_modules\index.js:42:5
gyp verb `which` failed     at C:\Users\\Documents\PROJETOS\\node_modules\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:158:21)
gyp verb `which` failed  python2 Error: not found: python2
gyp verb `which` failed     at getNotFoundError (C:\Users\\Documents\PROJETOS\RedeCotizadorFronode_modules\broccoli-sass-source-maps\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\Users\\Documents\PROJETOS\\node_moduoccoli-sass-source-maps\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\Users\\Documents\PROJETOS\\node_moduoccoli-sass-source-maps\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\Users\\Documents\PROJETOS\\node_modulesoli-sass-source-maps\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\Users\\Documents\PROJETOS\\node_modules\index.js:42:5
gyp verb `which` failed     at C:\Users\\Documents\PROJETOS\\node_modules\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:158:21) {
gyp verb `which` failed   stack: 'Error: not found: python2\n' +
gyp verb `which` failed     '    at getNotFoundError (C:\\Users\\\\Documents\\PROJETOS\\RedeCorFrontEnd\\node_modules\\broccoli-sass-source-maps\\node_modules\\which\\which.js:13:12)\n' +
gyp verb `which` failed     '    at F (C:\\Users\\\\Documents\\PROJETOS\\_modules\\broccoli-sass-source-maps\\node_modules\\which\\which.js:68:19)\n' +
gyp verb `which` failed     '    at E (C:\\Users\\\\Documents\\PROJETOS\\_modules\\broccoli-sass-source-maps\\node_modules\\which\\which.js:80:29)\n' +
gyp verb `which` failed     '    at C:\\Users\\\\Documents\\PROJETOS\\\\ndules\\broccoli-sass-source-maps\\node_modules\\which\\which.js:89:16\n' +
gyp verb `which` failed     '    at C:\\Users\\\\Documents\\PROJETOS\\\\ndules\\isexe\\index.js:42:5\n' +
gyp verb `which` failed     '    at C:\\Users\\\\Documents\\PROJETOS\\\\ndules\\isexe\\windows.js:36:5\n' +
gyp verb `which` failed     '    at FSReqCallback.oncomplete (fs.js:158:21)',
gyp verb `which` failed   code: 'ENOENT'
gyp verb `which` failed }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` failed Error: not found: python
gyp verb `which` failed     at getNotFoundError (C:\Users\\Documents\PROJETOS\RedeCotizadorFronode_modules\broccoli-sass-source-maps\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\Users\\Documents\PROJETOS\\node_moduoccoli-sass-source-maps\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\Users\\Documents\PROJETOS\\node_moduoccoli-sass-source-maps\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\Users\\Documents\PROJETOS\\node_modulesoli-sass-source-maps\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\Users\\Documents\PROJETOS\\node_modules\index.js:42:5
gyp verb `which` failed     at C:\Users\\Documents\PROJETOS\\node_modules\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:158:21)
gyp verb `which` failed  python Error: not found: python
gyp verb `which` failed     at getNotFoundError (C:\Users\\Documents\PROJETOS\RedeCotizadorFronode_modules\broccoli-sass-source-maps\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\Users\\Documents\PROJETOS\\node_moduoccoli-sass-source-maps\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\Users\\Documents\PROJETOS\\node_moduoccoli-sass-source-maps\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\Users\\Documents\PROJETOS\\node_modulesoli-sass-source-maps\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\Users\\Documents\PROJETOS\\node_modules\index.js:42:5
gyp verb `which` failed     at C:\Users\\Documents\PROJETOS\\node_modules\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:158:21) {
gyp verb `which` failed   stack: 'Error: not found: python\n' +
gyp verb `which` failed     '    at getNotFoundError (C:\\Users\\\\Documents\\PROJETOS\\RedeCorFrontEnd\\node_modules\\broccoli-sass-source-maps\\node_modules\\which\\which.js:13:12)\n' +
gyp verb `which` failed     '    at F (C:\\Users\\\\Documents\\PROJETOS\\_modules\\broccoli-sass-source-maps\\node_modules\\which\\which.js:68:19)\n' +
gyp verb `which` failed     '    at E (C:\\Users\\\\Documents\\PROJETOS\\_modules\\broccoli-sass-source-maps\\node_modules\\which\\which.js:80:29)\n' +
gyp verb `which` failed     '    at C:\\Users\\\\Documents\\PROJETOS\\\\ndules\\broccoli-sass-source-maps\\node_modules\\which\\which.js:89:16\n' +
gyp verb `which` failed     '    at C:\\Users\\\\Documents\\PROJETOS\\\\ndules\\isexe\\index.js:42:5\n' +
gyp verb `which` failed     '    at C:\\Users\\\\Documents\\PROJETOS\\\\ndules\\isexe\\windows.js:36:5\n' +
gyp verb `which` failed     '    at FSReqCallback.oncomplete (fs.js:158:21)',
gyp verb `which` failed   code: 'ENOENT'
gyp verb `which` failed }
gyp verb could not find "python". checking python launcher
gyp verb could not find "python". guessing location 
gyp verb ensuring that file exists: C:\Python27\python.exe
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (C:\Users\\Documents\PROJETOS\RedeCotizadorFronode_modules\broccoli-sass-source-maps\node_modules\node-gyp\lib\configure.js:484:19)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Users\\Documents\PROJETOS\RedeCotizadorFronode_modules\broccoli-sass-source-maps\node_modules\node-gyp\lib\configure.js:509:16)
gyp ERR! stack     at callback (C:\Users\\Documents\PROJETOS\\node_moduleeful-fs\polyfills.js:299:20)
gyp ERR! stack     at FSReqCallback.oncomplete (fs.js:158:21)
gyp ERR! System Windows_NT 10.0.19042
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN babel-plugin-debug-macros@0.2.0 requires a peer of @babel/core@^7.0.0-beta.42 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@3.13.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@3.13.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.   

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\\AppData\Roaming\npm-cache\_logs\2021-07-28T19_13_06_459Z-debug.log

But I've already tried everything below:

  1. Remove Node-Modules
  2. Delete Package-lock.json
  3. Install the latest node-sass version
  4. Install the latest version of gulp

But even so the same mistake perpetuates, I believe ember-cli is doing this.

How should I proceed to fix this problem? I use Windows and on an Intranet (Company).

My Versions:

node: v12.14.1
npm 6.13.4

PACKAGE.JSON:

{
  "name": "xp-investimentos-frontend",
  "version": "0.3.1",
  "description": "Small description for xp-investimentos-frontend goes here",
  "private": true,
  "directories": {
    "doc": "doc",
    "test": "tests"
  },
  "scripts": {
    "build": "ember build",
    "start": "ember server",
    "test": "ember test"
  },
  "repository": "",
  "engines": {
    "node": ">= 0.10.0"
  },
  "author": "",
  "license": "MIT",
  "devDependencies": {
    "broccoli-asset-rev": "^2.4.2",
    "ember-accordion": "0.3.6",
    "ember-ajax": "2.4.1",
    "ember-array-contains-helper": "1.3.2",
    "ember-bootstrap": "0.7.1",
    "ember-browserify": "1.1.9",
    "ember-charts": "1.0.0",
    "ember-cli": "2.5.0",
    "ember-cli-app-version": "1.0.0",
    "ember-cli-array-slice": "2.0.0",
    "ember-cli-babel": "5.2.1",
    "ember-cli-bootstrap-datepicker": "0.5.5",
    "ember-cli-bootstrap-sassy": "0.5.3",
    "ember-cli-clipboard": "0.8.1",
    "ember-cli-d3-shape": "0.8.5",
    "ember-cli-dependency-checker": "^1.2.0",
    "ember-cli-htmlbars": "^1.0.3",
    "ember-cli-htmlbars-inline-precompile": "^0.3.1",
    "ember-cli-inject-live-reload": "^1.4.0",
    "ember-cli-inline-content": "^0.4.1",
    "ember-cli-mirage": "0.2.4",
    "ember-cli-moment-shim": "2.0.0",
    "ember-cli-nouislider": "0.9.0",
    "ember-cli-pagination": "3.1.4",
    "ember-cli-release": "0.2.8",
    "ember-cli-sass": "5.3.1",
    "ember-cli-selectize": "0.5.5",
    "ember-cli-uglify": "^1.2.0",
    "ember-concurrency": "0.7.4",
    "ember-data": "^2.5.0",
    "ember-export-application-global": "^1.0.5",
    "ember-file-upload": "2.5.0",
    "ember-inflector": "2.1.0",
    "ember-inline-svg": "^0.1.7",
    "ember-inputmask": "0.2.2",
    "ember-load-initializers": "^0.5.1",
    "ember-maskmoney": "0.4.3",
    "ember-modal-dialog": "^2.4.4",
    "ember-models-table": "1.7.0",
    "ember-moment": "7.0.0-beta.3",
    "ember-radio-button": "1.0.7",
    "ember-resize": "0.0.12",
    "ember-resolver": "^2.0.3",
    "ember-route-action-helper": "2.0.1",
    "ember-truth-helpers": "1.3.0",
    "ember-uploader": "1.2.2",
    "hashcode": "^1.0.3",
    "ivy-tabs": "2.0.0",
    "jquery-maskmoney": "3.0.2",
    "liquid-fire": "0.27.0",
    "loader.js": "^4.0.1",
    "lodash": "^4.12.0",
    "moment": "^2.17.1",
    "node-sass": "^6.0.1",
    "phantomjs-prebuilt": "^2.1.14"
  },
  "dependencies": {
    "closest-num": "0.0.1",
    "currency-formatter": "^1.4.2",
    "ember-cli-data-export": "^0.1.29",
    "natives": "^1.1.6",
    "ocanvas": "^2.9.1",
    "percent-value": "^1.0.7",
    "socket.io": "^1.5.1"
  }
}



EmberJs 3.27 App in nested folder gets Uncaught RangeError: Maximum call stack size exceeded

I would like to serve my Ember 3.27 app from a sub folder '/v2/web'.

From a fresh project I have set rootURL: /v2/web' in my environment.js file and set the correct outputPath in my .ember-cli file. However the app won't run. I just get a white screen and 'Uncaught RangeError: Maximum call stack size exceeded.' in my console.

If I reset rootURL to the default '/' and then run ember serve, the page loads fine.

Any ideas anyone?




lundi 26 juillet 2021

Ember build error: Assertion Failed: [BUG] seen set should be available

Trying to update a Rails/Ember app and running into this error:

Template Compiler Error (broccoli-persistent-filter:TemplateCompiler) in ember-basic-dropdown/templates/components/basic-dropdown/content.hbs

Assertion Failed: [BUG] seen set should be available

Googled far and wide, but have not been able to find a fix. The only thing I found was this GitHub issue. Downgrading to 3.20.0 did not solve the issue.

Relevant packages:

"ember-cli": "^3.27.0",
"ember-data": "~3.26.0",



samedi 24 juillet 2021

Iterating over the nested Array in APi

I am trying to learn ember through building stuff, but now I am kind of stuck with looping through the nested array, Api is mine, so you can visit to see the data, anyway, the thing I am trying to accomplish is this, I want to display the category property, in this nested array I would like some help if possible.

import Route from '@ember/routing/route';
export default class BooksRoute extends Route {
  async model(){
    let response = await fetch('https://json-api-smaiil.herokuapp.com/books');
    let parsed = await response.json()
    console.log(parsed)
    return parsed.map((book) =>{
      let {categories} = book
    })
  }
}




Is it possible to make a parent route a 404, but the child route a specific route

In my router.js file, I have something that looks like the following

import EmberRouter from '@ember/routing/router';

const Router = EmberRouter.extend({});

Router.map(function () {
  this.route('index', { path: '/' });
  this.route('foo', function() {
    this.route('bar', function() {
      this.route('cat');
    });
  });

  this.route('notfound', { path: '/*path' });
});

export default Router;

The problem is that I want the path /foo/bar/cat to route to the foo.bar.cat route, but I don't want the paths /foo or /foo/bar to route to anything except a 404. In my case, the foo and bar routes are essentially useless. I just want the url to have 3 levels for aesthetic purposes.




vendredi 23 juillet 2021

How to update an objects' value in a @tracked array so that it could reflect the changes on screen in ember js

I have a function called updateData, whenever someone clicks on a cell, I want to update that cell in a array called state, it has 3 objects, and I want to update the key of first object. I tried many ways but none of them seems to be working, any help would be appreciated.

import Service from '@ember/service';
import { tracked } from '@glimmer/tracking';
import { action } from "@ember/object";



export default class TictactoeDataService extends Service {

    @tracked state = [{ "one": "1", "two": "", "three": "" }, { "one": "2", "two": "", "three": "" }, { "one": "3", "two": "", "three": "" }]
    get all() {
        return this.state
    }
    @action
    updateData(val) {
        this.state[0].two=val; // not updating 
        this.state=this.state // not working
    }
}




jeudi 22 juillet 2021

Ember JS - Link-to states it needs id (ERROR)

ROUTER.JS
this.route('widgets', function () {
     this.route('widget', {path: '/:widget_id' }, function () {
          this.route('files');
          this.route('agreements');
     }
});

HBS FILE:
<listGroup.link-to @route="toplevel.settings.widget.index">Widgets</listGroup.link-to>

I have a link-to in a profile settings menu that links to an hbs file that displays a list of widgets (not widgets, but it's proprietary, so for sake of example "widgets"). Each list item in the widgets hbs uses the transition-to helper to transition to a single widget. There are no issues so far. When I click on the nav with the original link-to to go back to the list of widgets I get this error:

"Uncaught (in promise) Error: While generating link to route "toplevel.settings.widgets.widget": You must provide param widget_id to generate."

Is the problem in the router.js file or in my link-to? I know the error states it's the link-to, however it does not error until trying to go back to the list, which does not need a specific id.




mercredi 21 juillet 2021

Access dropdown within

Ran into some problems trying to access a "ember-basic-dropdown-content-emberXXXX". The values of the dropdown, the seem only to exist once I click on the dropdown menu. When dropdown menu is active the values are generated as a childelement with parents “ember-basic-dropdown-wormhole”

What I want to access is <div id="ember-basic-dropdown-wormhole" data-identifyelement="28"></div> where I can find a childrens list(?)

<li class="ember-power-select-option" id="ember-power-select-options-ember341-1" aria-selected="false" aria-current="false" data-option-index="1" role="option">Order</li>

<li class="ember-power-select-option" id="ember-power-select-options-ember341-2" aria-selected="false" aria-current="true" data-option-index="2" role="option">Agent</li>

<li class="ember-power-select-option" id="ember-power-select-options-ember341-3" aria-selected="true" aria-current="false" data-option-index="3" role="option">Status<li>

Unfortunately the childrens list is not available unless I click on the dropdown menu/list. Having 100s of lists to click it would be great if I could use hotkeys and I would really appreciate som help. I'm totally stuck here.

If it is not possbile with js, may this be possible with brython?

 Thank you




lundi 19 juillet 2021

Ember build error: EEXIST: file already exists

I am trying to update an Ember/Ruby on Rails project that has not been deployed in two years (it's still happily running well in production, but new deploys fail).

I got the Ruby on Rails part to update, but Ember I am less familiar with and struggling, currently stuck on this error:

Build Error (TemplateCompiler)

EEXIST: file already exists, symlink '/var/folders/8m/vxpf7qd11fg7gn7ps0dyx_pc0000gn/T/broccoli-92657dOMHa3WeZnd7/out-335-funnel_funnel_ember_bootstrap_addon/ember-bootstrap/components/bs-accordion.js' -> '/var/folders/8m/vxpf7qd11fg7gn7ps0dyx_pc0000gn/T/broccoli-92657dOMHa3WeZnd7/out-336-template_compiler/ember-bootstrap/components/bs-accordion.js'

I have found similar errors online but none of the suggested fixes worked for me. I have the latest version of bootstrap, ember-bootstrap, broccoli-asset-rev and ember-cli. The files mentioned in the error are not from my project, as far asa I can tell they are from the ember-bootstrap package.

Current package.json inside app-ember:

{
  "name": "app-ember",
  "version": "0.0.0",
  "private": true,
  "description": "Small description for app-ember goes here",
  "repository": "",
  "license": "MIT",
  "author": "",
  "directories": {
    "doc": "doc",
    "test": "tests"
  },
  "scripts": {
    "build": "ember build",
    "lint:hbs": "ember-template-lint .",
    "lint:js": "eslint .",
    "start": "ember serve",
    "test": "COVERAGE=true ember test && rm coverage/coverage-summary.json && nyc check-coverage",
    "debug-test": "ember test --server"
  },
  "devDependencies": {
    "@ember/jquery": "^0.5.2",
    "@ember/optional-features": "^0.6.3",
    "active-model-adapter": "^2.2.0",
    "bootstrap": "^5.0.2",
    "broccoli-asset-rev": "^3.0.0",
    "ember-ajax": "^4.0.1",
    "ember-bootstrap": "^4.9.0",
    "ember-bootstrap-controls": "github:clevercase/ember-bootstrap-controls#v3.0.0",
    "ember-can": "^1.1.1",
    "ember-cli": "^3.27.0",
    "ember-cli-app-version": "^3.2.0",
    "ember-cli-babel": "^7.1.2",
    "ember-cli-code-coverage": "github:kategengler/ember-cli-code-coverage#v1.0.0-beta.8",
    "ember-cli-dependency-checker": "^3.2.0",
    "ember-cli-eslint": "^4.2.3",
    "ember-cli-htmlbars": "^4.3.1",
    "ember-cli-inject-live-reload": "^1.8.2",
    "ember-cli-moment-shim": "^3.7.1",
    "ember-cli-pretender": "^3.2.0",
    "ember-cli-rails-addon": "^0.10.0",
    "ember-cli-sass": "^10.0.1",
    "ember-cli-sri": "^2.1.1",
    "ember-cli-template-lint": "^2.0.2",
    "ember-cli-uglify": "^2.1.0",
    "ember-concurrency": "^0.9.0",
    "ember-data": "~3.14.0",
    "ember-data-change-tracker": "^0.8.0",
    "ember-export-application-global": "^2.0.1",
    "ember-freestyle": "^0.11.10",
    "ember-load-initializers": "^1.1.0",
    "ember-maybe-import-regenerator": "^0.1.6",
    "ember-moment": "^7.8.1",
    "ember-notify": "^5.3.0",
    "ember-percy": "^1.6.0",
    "ember-power-calendar": "^0.13.3",
    "ember-power-calendar-moment": "^0.1.7",
    "ember-print-this": "^1.0.0",
    "ember-qunit": "^3.4.1",
    "ember-resolver": "^5.3.0",
    "ember-route-action-helper": "^2.0.8",
    "ember-simple-auth": "^1.9.2",
    "ember-source": "^3.8.3",
    "ember-spreadsheet-export": "^0.4.0",
    "ember-steps": "^8.0.2",
    "ember-welcome-page": "^3.2.0",
    "eslint-plugin-ember": "^5.2.0",
    "loader.js": "^4.7.0",
    "lolex": "^3.1.0",
    "nyc": "^15.1.0",
    "popper.js": "^1.16.1",
    "qunit-dom": "^0.8.5"
  },
  "engines": {
    "node": "6.* || 8.* || >= 10.*"
  }
}



Ember CLI tests fails inside dev container

I'm working in a VSCode Dev Container on Debian Release 10. I'm able to run CI=true ember test in my own terminal without fail but running it in my container instance throws;

not ok 1 Chrome - [undefined ms] - error
    ---
        message: >
            Error: Browser exited unexpectedly
            Non-zero exit code: null
            Stderr: 
             qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
            qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
            [0719/094328.695395:ERROR:bus.cc(393)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
            [0719/094328.705723:ERROR:file_path_watcher_linux.cc(326)] inotify_init() failed: Function not implemented (38)
            [0719/094328.826667:ERROR:gpu_process_host.cc(996)] GPU process launch failed: error_code=1002
            [0719/094328.827080:WARNING:gpu_process_host.cc(1316)] The GPU process has crashed 1 time(s)
            
            DevTools listening on ws://127.0.0.1:38109/devtools/browser/fe31b478-52ab-4169-aa4a-9263c3f2a29f
            qemu: unknown option 'type=utility'
            [0719/094328.888291:ERROR:gpu_process_host.cc(996)] GPU process launch failed: error_code=1002
            [0719/094328.888371:WARNING:gpu_process_host.cc(1316)] The GPU process has crashed 2 time(s)
            [0719/094329.022382:ERROR:gpu_process_host.cc(996)] GPU process launch failed: error_code=1002
            [0719/094329.022475:WARNING:gpu_process_host.cc(1316)] The GPU process has crashed 3 time(s)
            [0719/094329.022628:FATAL:gpu_data_manager_impl_private.cc(415)] GPU process isn't usable. Goodbye.
            qemu: uncaught target signal 11 (Segmentation fault) - core dumped
            
            
        browser log: |
            {"type":"error","text":"Error: Browser exited unexpectedly"}
            {"type":"error","text":"Non-zero exit code: null"}
            {"type":"error","text":"qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped\nqemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped\n[0719/094328.695395:ERROR:bus.cc(393)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory\n[0719/094328.705723:ERROR:file_path_watcher_linux.cc(326)] inotify_init() failed: Function not implemented (38)\n[0719/094328.826667:ERROR:gpu_process_host.cc(996)] GPU process launch failed: error_code=1002\n[0719/094328.827080:WARNING:gpu_process_host.cc(1316)] The GPU process has crashed 1 time(s)\n\nDevTools listening on ws://127.0.0.1:38109/devtools/browser/fe31b478-52ab-4169-aa4a-9263c3f2a29f\nqemu: unknown option 'type=utility'\n[0719/094328.888291:ERROR:gpu_process_host.cc(996)] GPU process launch failed: error_code=1002\n[0719/094328.888371:WARNING:gpu_process_host.cc(1316)] The GPU process has crashed 2 time(s)\n[0719/094329.022382:ERROR:gpu_process_host.cc(996)] GPU process launch failed: error_code=1002\n[0719/094329.022475:WARNING:gpu_process_host.cc(1316)] The GPU process has crashed 3 time(s)\n[0719/094329.022628:FATAL:gpu_data_manager_impl_private.cc(415)] GPU process isn't usable. Goodbye.\nqemu: uncaught target signal 11 (Segmentation fault) - core dumped\n"}

I'm using these arguments in my testem

ci: [
        // --no-sandbox is needed when running Chrome inside a container
        process.env.CI ? '--no-sandbox' : null,
        '--headless',
        '--disable-dev-shm-usage',
        '--disable-software-rasterizer',
        '--mute-audio',
        '--remote-debugging-port=0',
        '--window-size=1440,900',
      ]



mercredi 14 juillet 2021

How to import types for jquery in Ember with typescript?

I would like to import the type JQuery.Event in order to use it in a click function. What's the right way to do that? I've already looked it up on other sites, but cannot find anything.

Thanks in advance.




lundi 12 juillet 2021

How to programatically add component via controller action in Ember 3.x

I want to add add multiple copies of a component via js and pass different params in it. The code should execute via controller action of click on a button in the template. The solution for 2.x doesn't work in Ember version 3.x(pre-octane). Can anybody please help. I can't render plain html as I am using other addon of ember in the component.




mardi 6 juillet 2021

How to import node.js child_process to Ember Electron app?

I'm trying to convert a node.js app to Ember Electron app. In the node.js app I use:

  • const spawn = require('child_process').spawnSync;

but don't know how to import 'child_process' into Ember Electron app. Have tried:

  • import { child_process } from 'child_process'; // blows up: requireNode is not a function

and also:

  • import requireModule from 'ember-require-module';
  • const child_process = requireModule('child_process'); // does not find it

Maybe using node.js is a wrong approach in Ember Electron app? Any idea appreciated. Thanks.




Can not dynamically update li after drag and drop using Sortable library

I am using the jQuery Sortable library for my Ember Js Project. It is working nicely with my <li> elements. But after I drag and drop elements I am unable to dynamically move the element.

Is there any way to do so or re-render my HBS.

Thank you




lundi 5 juillet 2021

Is there way to transfer images to a directory in an IoT edge device using Node-JS?

I have been working on a Node-JS application that requires uploading an image to a Amazon-S3 bucket for and then being inferenced using ML on IoT Edge devices running remotely and uploading the inference data on the cloud as a part of my internship. However if I want to directly run the inference when the edge device is available locally connected to my network , I can't find a way to do so. Technically I want to transfer the image to a directory dpu_models/images/ in the local edge device , run some command that will trigger the same inference as it happens on uploading image to AWS-S3. I'm quite new to this edge device and greengrass technology , only having developed Node-JS projects that just deal with databases prior to this and unable to get proper mentor guidance due to pandemic work from home. So any help will be appreciated , even just reference to proper materials to learn how to do this will be good enough for me.




Share common relationships between Ember (Octane) models

In our Rails backend, we have a lot of Concerns server side. For example, several models import an AppointableConcern which allows the resources to be associated with Appointments.

In our Ember Octane models, we use inheritance instead, and I'm not sure whether that's a good idea. For example, we have these two models...

// models/groupable.js
import { belongsTo } from '@ember-data/model';
import ApplicationModel from './application'

export default ApplicationModel.extend({
  group: belongsTo('group', { inverse: 'groupables' }),
});

// models/appointable.js
import { hasMany } from '@ember-data/model';
import Groupable from './groupable';

export default Groupable.extend({
  appointments: hasMany('appointment')
});

... as well as some models extending either Appointable or Groupable.

To me it seems inheritance has been abused to share logic between classes that are not closely related: An Appointable is not a specific implementation of a Groupable (multiple Groupables can form a Group) at all.

Now I wonder:

  • Is this a recommended/standard way to share logic between models?
  • Is there a more flexible alternative? Considering my example above, directly using group: belongsTo('group', { inverse: 'groupables' }) in any model that should be groupable and appointments: hasMany('appointment') in all models that appointments should be allowed to associate with seems like a simple solution.



If we get some error on API (4xx or 5xx), we should be showing something on the screen

How to handle such errors and show message on the screen?

The code is:

import Route from '@ember/routing/route';
import ENV from 'website-my/config/environment';

const API_BASE_URL = ENV.BASE_API_URL;

export default class TasksRoute extends Route {
  model = async () => {
    const response = await fetch(`${API_BASE_URL}/tasks/self`, {
      credentials: 'include',
    });
    const allTasks = await response.json();

    return allTasks;
  };
}

I want to add error handling in this, How to do that?