Skip to content

v9u/sqlite_test

Repository files navigation

pnpm install sqlite3 demo, for electron project

node-linker=hoisted
public-hoist-pattern=*
shamefully-hoist=true

2.init: pnpm i,

3.dev: pnpm start

4.build: pnpm build

error and fix:

1. No such file or directory: "../../../../[folder]/nothing.c"

fix: path too long! use short path

2. node_modules\pnpm\bin\pnpm.cjs: %1 is not a valid Win32 application.:

PS F:\t\db_test> pnpm build

> [email protected] build F:\t\db_test
> electron-builder

  • electron-builder  version=23.6.0 os=10.0.19044
  • loaded configuration  file=package.json ("build" field)
rch=x64
  ⨯ cannot execute  cause=fork/exec C:\Users\Administrator\AppData\Local\pnpm\global\5\.pnpm\[email protected]\node_modules\pnpm\bin\pnpm.cjs: %1 is not a valid Win32 application.
                    command='C:\Users\Administrator\AppData\Local\pnpm\global\5\.pnpm\[email protected]\node_modules\pnpm\bin\pnpm.cjs' rebuild [email protected]

                    workingDir=
 ELIFECYCLE  Command failed with exit code 1.
PS F:\t\db_test>

fix :(ref: electron-userland/electron-builder#6933 (comment)): open file C:\Users\Administrator\AppData\Local\pnpm\global\5\.pnpm\[email protected]\node_modules\pnpm\bin\pnpm.cjs, replace #!/usr/bin/env node with #!node

note: use const sqlite3 = require('sqlite3'), no import sqlite3 from 'sqlite3'

About

build failed

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published