No Code Attached Yet bug
avatar brianteeman
brianteeman
16 Nov 2023

Since the change to lightningcss I am unable to successfully conmplete npm install

PS C:\laragon\www\j5> npm install
npm WARN deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead

> joomla@5.0.1 install
> node build/build.js --prepare

node:internal/modules/cjs/loader:1051
  throw err;
  ^

Error: Cannot find module '../lightningcss.win32-x64-msvc.node'
Require stack:
- C:\laragon\www\j5\node_modules\lightningcss\node\index.js
- C:\laragon\www\j5\build\build-modules-js\error-pages.es6.js
- C:\laragon\www\j5\build\build.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1048:15)
    at Module._load (node:internal/modules/cjs/loader:901:27)
    at Module.require (node:internal/modules/cjs/loader:1115:19)
    at require (node:internal/modules/helpers:130:18)
    at Object.<anonymous> (C:\laragon\www\j5\node_modules\lightningcss\node\index.js:21:22)
    at Module._compile (node:internal/modules/cjs/loader:1233:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1287:10)
    at Module.load (node:internal/modules/cjs/loader:1091:32)
    at Module._load (node:internal/modules/cjs/loader:938:12)
    at Module.require (node:internal/modules/cjs/loader:1115:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\laragon\\www\\j5\\node_modules\\lightningcss\\node\\index.js',
    'C:\\laragon\\www\\j5\\build\\build-modules-js\\error-pages.es6.js',
    'C:\\laragon\\www\\j5\\build\\build.js'
  ]
}

Node.js v20.5.1
npm ERR! code 1
npm ERR! path C:\laragon\www\j5
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node build/build.js --prepare

npm ERR! A complete log of this run can be found in: C:\Users\brian\AppData\Local\npm-cache\_logs\2023-11-16T17_13_46_278Z-debug-0.log

avatar brianteeman brianteeman - open - 16 Nov 2023
avatar joomla-cms-bot joomla-cms-bot - change - 16 Nov 2023
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 16 Nov 2023
avatar Fedik
Fedik - comment - 16 Nov 2023

No idea,
Maybe try to remove whole \node_modules\ folder manualy, and run it again.

avatar brianteeman
brianteeman - comment - 16 Nov 2023

already did that before posting

avatar N6REJ
N6REJ - comment - 17 Nov 2023

Can confirm even using the very latest nodejs which was released on the 13th ( 21.2.0 )
image
2023-11-17T00_37_50_556Z-debug-0.log

avatar brianteeman
brianteeman - comment - 17 Nov 2023

It appears to be a fairly frequent issue with npm and lightningcss that has effected different platforms (not just windows) with npm not fetching the optional dependencies which maybe are not optional after all

image

avatar brianteeman
brianteeman - comment - 17 Nov 2023

Looks like I have fixed it by deleting \node_modules AND package-lock.json

avatar chmst
chmst - comment - 17 Nov 2023

Did not help for me.

code: 'MODULE_NOT_FOUND',
requireStack: [
'D:\xampp\htdocs\joomla-50\node_modules\lightningcss\node\index.js',
'D:\xampp\htdocs\joomla-50\build\build-modules-js\error-pages.es6.js',
'D:\xampp\htdocs\joomla-50\build\build.js'

avatar brianteeman
brianteeman - comment - 17 Nov 2023

tried again and it failed again. deleting everything is not a fix.

avatar Fedik Fedik - change - 17 Nov 2023
Labels Added: bug
avatar Fedik Fedik - labeled - 17 Nov 2023
avatar Fedik
Fedik - comment - 17 Nov 2023

Hmhm, does command npm install lightningcss-win32-x64-msvc work for you, or it end up with error?

avatar brianteeman
brianteeman - comment - 17 Nov 2023

If you do that and then try to do a full npm install you just move on to the next error message which is also from the same PR

Embedded Dart Sass couldn't find the embedded compiler executable. Please make sure the optional dependency sass-embedded-win32-x64 is installed in node_modules.

avatar brianteeman
brianteeman - comment - 17 Nov 2023

Seems to be a common problem with platform specific optional dependencies npm/cli#4828

avatar chmst
chmst - comment - 17 Nov 2023

Thank you both very much for investigating! This is somehow annoying as I have only windows

avatar brianteeman
brianteeman - comment - 17 Nov 2023

More than annoying

avatar chmst
chmst - comment - 17 Nov 2023

It works on 5.1 - dev

avatar Fedik
Fedik - comment - 17 Nov 2023

I think it not upmerged yet.
Does it work on 4.4? the original PR was for 4.4-dev #42325

avatar chmst
chmst - comment - 17 Nov 2023

not on 4.4.1 - dev. But other error.

grafik

avatar Fedik
Fedik - comment - 18 Nov 2023

I have tried to test it on VirtualBox Win10, node v20.9.
4.4-dev works.

5.0-dev:
Does not work,
Need to remove package-lock.json file and node_modules folder. Then it work for me.

avatar Fedik Fedik - change - 18 Nov 2023
Title
npm fails on windows
[5.0] npm fails on windows
avatar Fedik Fedik - edited - 18 Nov 2023
avatar brianteeman
brianteeman - comment - 18 Nov 2023

Which is not realistic

avatar Fedik
Fedik - comment - 18 Nov 2023

I would make you video, but VirtualBox so slow, it will take ages ?

avatar Fedik
Fedik - comment - 18 Nov 2023

Can you please try lock file from this PR #42361

avatar chmst
chmst - comment - 18 Nov 2023

tested and works

avatar Fedik Fedik - change - 18 Nov 2023
Status New Closed
Closed_Date 0000-00-00 00:00:00 2023-11-18 13:40:15
Closed_By Fedik
avatar Fedik Fedik - close - 18 Nov 2023
avatar Fedik
Fedik - comment - 18 Nov 2023

Okay, will count this as a fix #42361.

avatar brianteeman
brianteeman - comment - 18 Nov 2023

the pr was closed but the problem still exists!!!
please reopen

avatar Fedik Fedik - change - 18 Nov 2023
Status Closed New
Closed_Date 2023-11-18 13:40:15
Closed_By Fedik
avatar Fedik Fedik - reopen - 18 Nov 2023
avatar coolcat-creations
coolcat-creations - comment - 19 Nov 2023

I had this issue as well but solved it with that:

nvm uninstall node
arch -x86_64 zsh

arch -x86_64 zsh

rm -rf node_modules
rm package-lock.json
npm install

nvm install node
source ~/.nvm/nvm.sh

avatar bembelimen
bembelimen - comment - 20 Nov 2023

Please check with the current 5.0-dev branch.

avatar brianteeman
brianteeman - comment - 20 Nov 2023

appears to be ok - thx

avatar Fedik Fedik - change - 20 Nov 2023
Status New Closed
Closed_Date 0000-00-00 00:00:00 2023-11-20 19:06:16
Closed_By Fedik
avatar Fedik Fedik - close - 20 Nov 2023

Add a Comment

Login with GitHub to post a comment