Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails with node 18.14 #326

Open
Nuranto opened this issue Feb 3, 2023 · 1 comment
Open

Build fails with node 18.14 #326

Nuranto opened this issue Feb 3, 2023 · 1 comment

Comments

@Nuranto
Copy link

Nuranto commented Feb 3, 2023

Our CI keeps failing since this morning, because of the fresh 18.14 node's release.

Our previous builds with 18.13 were OK.

Here's the error message with 18.14 :

npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /var/www/html/vendor/hyva-themes/magento2-react-checkout/src/reactapp/src/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/var/www/html/vendor/hyva-themes/magento2-react-checkout/src/reactapp/src/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

For some reason, it's looking for reactapp/src/package.json instead of reactapp/package.json

Error log file :

0 verbose cli /usr/bin/node /usr/bin/npm
1 info using npm@9.3.1
2 info using node@v18.14.0
3 timing npm:load:whichnode Completed in 2ms
4 timing config:load:defaults Completed in 4ms
5 timing config:load:file:/usr/lib/node_modules/npm/npmrc Completed in 0ms
6 timing config:load:builtin Completed in 5ms
7 timing config:load:cli Completed in 2ms
8 timing config:load:env Completed in 1ms
9 timing config:load:file:/var/www/html/app/code/Hyva/CheckoutExample/reactapp/.npmrc Completed in 4ms
10 timing config:load:project Completed in 10ms
11 timing config:load:file:/root/.npmrc Completed in 0ms
12 timing config:load:user Completed in 1ms
13 timing config:load:file:/usr/etc/npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:setEnvs Completed in 3ms
16 timing config:load Completed in 27ms
17 timing npm:load:configload Completed in 27ms
18 timing npm:load:mkdirpcache Completed in 4ms
19 timing npm:load:mkdirplogs Completed in 1ms
20 verbose title npm install
21 verbose argv "install"
22 timing npm:load:setTitle Completed in 2ms
23 timing config:load:flatten Completed in 3ms
24 timing npm:load:display Completed in 4ms
25 verbose logfile logs-max:10 dir:/root/.npm/_logs/2023-02-03T11_00_52_286Z-
26 verbose logfile /root/.npm/_logs/2023-02-03T11_00_52_286Z-debug-0.log
27 timing npm:load:logFile Completed in 5ms
28 timing npm:load:timers Completed in 0ms
29 timing npm:load:configScope Completed in 0ms
30 timing npm:load Completed in 46ms
31 timing arborist:ctor Completed in 1ms
32 silly logfile done cleaning log files
33 verbose shrinkwrap failed to load node_modules/.package-lock.json out of date, updated: node_modules
34 timing idealTree:init Completed in 2453ms
35 timing idealTree:userRequests Completed in 0ms
36 silly idealTree buildDeps
37 silly fetch manifest @hyva/react-checkout@file:../../../../../vendor/hyva-themes/magento2-react-checkout/src/reactapp/src
38 silly placeDep ROOT @hyva/react-checkout@ REPLACE for:  want: file:../../../../../vendor/hyva-themes/magento2-react-checkout/src/reactapp/src
39 timing idealTree:#root Completed in 21ms
40 timing idealTree:node_modules/@hyva/react-checkout Completed in 0ms
41 timing idealTree:buildDeps Completed in 23ms
42 timing idealTree:fixDepFlags Completed in 20ms
43 timing idealTree Completed in 2498ms
44 timing command:install Completed in 2508ms
45 verbose stack Error: ENOENT: no such file or directory, open '/var/www/html/vendor/hyva-themes/magento2-react-checkout/src/reactapp/src/package.json'
46 verbose cwd /var/www/html/app/code/Hyva/CheckoutExample/reactapp
47 verbose Linux 5.15.49-linuxkit
48 verbose node v18.14.0
49 verbose npm  v9.3.1
50 error code ENOENT
51 error syscall open
52 error path /var/www/html/vendor/hyva-themes/magento2-react-checkout/src/reactapp/src/package.json
53 error errno -2
54 error enoent ENOENT: no such file or directory, open '/var/www/html/vendor/hyva-themes/magento2-react-checkout/src/reactapp/src/package.json'
55 error enoent This is related to npm not being able to find a file.
55 error enoent
56 verbose exit -2
57 timing npm Completed in 2572ms
58 verbose unfinished npm timer reify 1675422052348
59 verbose unfinished npm timer reify:loadTrees 1675422052353
60 verbose code -2
61 error A complete log of this run can be found in:
61 error     /root/.npm/_logs/2023-02-03T11_00_52_286Z-debug-0.log
@Nuranto Nuranto changed the title Build fails with node 18.4 Build fails with node 18.14 Feb 3, 2023
@rajeev-k-tomy
Copy link
Collaborator

I believe you are using example template module to extend the react checkout. This particular error happens due the setting here: https://github.com/hyva-themes/magento2-checkout-example/blob/master/reactapp/package.json#L17

If you remove that line, probably you may be able to successfully build it again. That line is added in order to include the original reactapp as a library inside the example template reactapp. In the background, it creates symlinks to the vendor directory. This will help IDE to correctly suggest paths which is highly helpful while customizing the react part.

Need to find a solution to fix this problem. This issue was reported before in older node versions as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants