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

Error after ''npm init saas-boilerplate''. I have all requirements #430

Open
5 tasks done
giuseppe-coco opened this issue Nov 12, 2023 · 3 comments
Open
5 tasks done
Labels
bug Something isn't working

Comments

@giuseppe-coco
Copy link

giuseppe-coco commented Nov 12, 2023

Describe the bug

postinstall$ node packages/internal/cli/scripts/build.js
│ node:events:492
│ throw er; // Unhandled 'error' event
│ ^
│ Error: spawn pnpm ENOENT
│ at ChildProcess._handle.onexit (node:internal/child_process:286:19)
│ at onErrorNT (node:internal/child_process:484:16)
│ at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
│ Emitted 'error' event on ChildProcess instance at:
│ at ChildProcess._handle.onexit (node:internal/child_process:292:12)
│ at onErrorNT (node:internal/child_process:484:16)
│ at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
│ code: 'ENOENT',
│ syscall: 'spawn pnpm',
│ path: 'pnpm',
│ spawnargs: [ 'run', 'build' ]
│ }
│ Node.js v20.9.0
└─ Failed in 179ms at C:\Users\ccpep\Desktop\saas-boilerplate
Installing dependencies... !
Error: Command failed: pnpm i --frozen-lockfile
npm ERR! code 1
npm ERR! path C:\Users\ccpep\Desktop\saas-boilerplate
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c create-saas-boilerplate

npm ERR! A complete log of this run can be found in: C:\Users\ccpep\AppData\Local\npm-cache_logs\2023-11-12T16_27_29_802Z-debug-0.log

Steps to reproduce

  1. Go to dir /saas-boilerplate
  2. Run npm init saas-boilerplate

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (8) x64 AMD Ryzen 5 2500U with Radeon Vega Mobile Gfx
    Memory: 12.33 GB / 18.90 GB
  Binaries:
    Node: 20.9.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.1.0 - C:\Program Files\nodejs\npm.CMD
    pnpm: 8.10.3 - ~\AppData\Roaming\npm\pnpm.CMD
  Browsers:
    Edge: Spartan (44.19041.3570.0), Chromium (119.0.2151.58)
    Internet Explorer: 11.0.19041.3570

Logs

No response

Validations

@mkleszcz
Copy link
Contributor

mkleszcz commented Dec 6, 2023

Hello @giuseppe-coco,
I'm trying to reproduce your issue on the Windows machine but without any luck... Not sure might cause your issue but when looking into the code I see that there might be one line missing in packages/internal/cli/scripts/lib/runCommand.js.
Could you modify this file (after the init script will copy the SB repository into your location) and add the following line:

shell: process.platform === 'win32',

after

stdio: 'inherit',

so the code will look like:

const cmd = spawn(command, args, {
      stdio: 'inherit',
      shell: process.platform === 'win32',
      ...options,
    });

Then, please run pnpm i and we'll see if the packages will build correctly

@mkleszcz mkleszcz added the bug Something isn't working label Dec 6, 2023
@mm51165
Copy link

mm51165 commented Jan 16, 2024

Hello @giuseppe-coco, I'm trying to reproduce your issue on the Windows machine but without any luck... Not sure might cause your issue but when looking into the code I see that there might be one line missing in packages/internal/cli/scripts/lib/runCommand.js. Could you modify this file (after the init script will copy the SB repository into your location) and add the following line:

shell: process.platform === 'win32',

after

stdio: 'inherit',

so the code will look like:

const cmd = spawn(command, args, {
      stdio: 'inherit',
      shell: process.platform === 'win32',
      ...options,
    });

Then, please run pnpm i and we'll see if the packages will build correctly

I had the same issue; this resolved it for me. I'm not sure how the line was missing for me since I've used the 'starter kit' setup.

@giuseppe-coco
Copy link
Author

Hello @giuseppe-coco, I'm trying to reproduce your issue on the Windows machine but without any luck... Not sure might cause your issue but when looking into the code I see that there might be one line missing in packages/internal/cli/scripts/lib/runCommand.js. Could you modify this file (after the init script will copy the SB repository into your location) and add the following line:

shell: process.platform === 'win32',

after

stdio: 'inherit',

so the code will look like:

const cmd = spawn(command, args, {
      stdio: 'inherit',
      shell: process.platform === 'win32',
      ...options,
    });

Then, please run pnpm i and we'll see if the packages will build correctly

I modified the code as you wrote, but when I run pnpm i get an error :
pnpm i
packages/webapp |  WARN  The field "pnpm" was found in C:\Users\ccpep\Desktop\projects\saas-boilerplate\packages\webapp/package.json. This will not take effect. You should configure "pnpm" at the root of the workspace instead.
Scope: all 23 workspace projects
Lockfile is up to date, resolution step is skipped
Already up to date
. postinstall$ node packages/internal/cli/scripts/build.js
│ node:events:496
│ throw er; // Unhandled 'error' event
│ ^
│ Error: spawn pnpm ENOENT
│ at ChildProcess._handle.onexit (node:internal/child_process:286:19)
│ at onErrorNT (node:internal/child_process:484:16)
│ at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
│ Emitted 'error' event on ChildProcess instance at:
│ at ChildProcess._handle.onexit (node:internal/child_process:292:12)
│ at onErrorNT (node:internal/child_process:484:16)
│ at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
│ errno: -4058,
│ code: 'ENOENT',
│ syscall: 'spawn pnpm',
│ path: 'pnpm',
│ spawnargs: [ 'run', 'build' ]
│ }
│ Node.js v20.11.0
└─ Failed in 72ms at C:\Users\ccpep\Desktop\projects\saas-boilerplate
 ELIFECYCLE  Command failed with exit code 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants