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

Cannot use sample on new OS installation (see detail) #741

Closed
tebeco opened this issue Oct 28, 2022 · 0 comments
Closed

Cannot use sample on new OS installation (see detail) #741

tebeco opened this issue Oct 28, 2022 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@tebeco
Copy link
Contributor

tebeco commented Oct 28, 2022

TLDR: known bug, require to update at least parcel and lmdb
jump to "googling" section bellow

Expectations

  • new windows installation
  • install git
  • install node
  • DO NOT install python
  • DO NOT install any VS related
  • DO NOT install any VC++ related
  • git clone https://github.com/authts/oidc-client-ts
  • cd samples/Parcel
  • npm ci && npm run start

Current behavior

❯ npm ci
npm ERR! code 1
npm ERR! path C:\dev\github\oidc-client-ts\samples\Parcel\node_modules\lmdb
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node-gyp-build
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.1.0
npm ERR! gyp info using node@19.0.0 | win32 | x64
npm ERR! gyp info find Python using Python version 3.9.7 found at "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\python.exe"
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS msvs_version not set from command line or npm config
npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp ERR! find VS checking VS2022 (17.4.33015.44) found at:
npm ERR! gyp ERR! find VS "C:\Program Files\Microsoft Visual Studio\2022\Preview"
npm ERR! gyp ERR! find VS - found "Visual Studio C++ core features"
npm ERR! gyp ERR! find VS - missing any VC++ toolset
npm ERR! gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
npm ERR! gyp ERR! find VS looking for Visual Studio 2015
npm ERR! gyp ERR! find VS - not found
npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload.
npm ERR! gyp ERR! find VS For more information consult the documentation at:
npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use
npm ERR! gyp ERR! stack     at VisualStudioFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:122:47)
npm ERR! gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:75:16
npm ERR! gyp ERR! stack     at VisualStudioFinder.findVisualStudio2013 (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:364:14)
npm ERR! gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:71:14
npm ERR! gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:385:16
npm ERR! gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
npm ERR! gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:420:5)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1098:16)
npm ERR! gyp ERR! System Windows_NT 10.0.22621
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\dev\github\oidc-client-ts\samples\Parcel\node_modules\lmdb
npm ERR! gyp ERR! node -v v19.0.0
npm ERR! gyp ERR! node-gyp -v v9.1.0
npm ERR! gyp ERR! not ok

Attempt one: Avoiding post install etc ...

  • npm ci --ignore-scripts
  • ci succeed BUT
  • npm run start
❯ npm start

> start
> concurrently --kill-others "npm run serve" "npm run server"

[1]
[1] > server
[1] > node ./server.js
[1]
[0]
[0] > serve
[0] > parcel serve ./src/index.html
[0]
[1] listening on http://localhost:1234
[0] Error: No native build was found for platform=win32 arch=x64 runtime=node abi=111 uv=1 libc=glibc node=19.0.0
[0]     loaded from: C:\dev\github\oidc-client-ts\samples\Parcel\node_modules\lmdb
[0]
[0]     at load.path (C:\dev\github\oidc-client-ts\samples\Parcel\node_modules\node-gyp-build\index.js:60:9)
[0]     at load (C:\dev\github\oidc-client-ts\samples\Parcel\node_modules\node-gyp-build\index.js:22:30)
[0]     at Object.<anonymous> (C:\dev\github\oidc-client-ts\samples\Parcel\node_modules\lmdb\dist\index.cjs:2257:47)
[0]     at Module._compile (C:\dev\github\oidc-client-ts\samples\Parcel\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
[0]     at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
[0]     at Module.load (node:internal/modules/cjs/loader:1037:32)
[0]     at Module._load (node:internal/modules/cjs/loader:878:12)
[0]     at Module.require (node:internal/modules/cjs/loader:1061:19)
[0]     at require (C:\dev\github\oidc-client-ts\samples\Parcel\node_modules\v8-compile-cache\v8-compile-cache.js:159:20)
[0]     at _lmdb (C:\dev\github\oidc-client-ts\samples\Parcel\node_modules\@parcel\cache\lib\LMDBCache.js:51:39)
[0] npm run serve exited with code 1
--> Sending SIGTERM to other processes..
[1] npm run server exited with code 1

Attempt 2: force

  • npm install --force
    (same failure as "exceptation")

Attempt 3: force + ignore

  • npm i --force --ignore-scripts
  • install will work but start will fail just like it did for Attempt 2

Google time

That's a know issue that's supposdly fixed:
parcel-bundler/parcel#8152

Fix:

  • Update dependencies to latest: only minor or patch, no apparent breaking change
  • npm i --force (worked without --ignore-scripts)
  • as quoted in issue: node -e "console.log(require('lmdb'))" should work to validate:
❯ node -e "console.log(require('lmdb'))"
{
  clearKeptObjects: [Function (anonymous)],
  v8AccelerationEnabled: false,
  bufferToKeyValue: [Getter],
  compareKey: [Getter],
  compareKeys: [Getter],
  keyValueToBuffer: [Getter],
  ABORT: {},
  IF_EXISTS: 3.542694326329068e-103,
  TransactionFlags: { ABORTABLE: 1, SYNCHRONOUS_COMMIT: 2, NO_SYNC_FLUSH: 65536 },
  allDbs: Map(0) {},
  asBinary: [Function: asBinary],
  default: {
    open: [Function: open],
    openAsClass: [Function: openAsClass],
    getLastVersion: [Function: getLastVersion],
    compareKey: [Function: compareKeys],
    keyValueToBuffer: [Function: toBufferKey],
    bufferToKeyValue: [Function: fromBufferKey],
    ABORT: {},
    IF_EXISTS: 3.542694326329068e-103,
    asBinary: [Function: asBinary],
    levelup: [Function: levelup],
    TransactionFlags: { ABORTABLE: 1, SYNCHRONOUS_COMMIT: 2, NO_SYNC_FLUSH: 65536 }
  },
  getLastVersion: [Function: getLastVersion],
  levelup: [Function: levelup],
  noop: undefined,
  open: [Function: open],
  openAsClass: [Function: openAsClass]
}
  • that seems to be a clean stdout and not stderr => all good ?
  • npm run start => WORKS !
❯ npm run start

> start
> concurrently --kill-others "npm run serve" "npm run server"

[0]
[0] > serve
[0] > parcel serve ./src/index.html
[0]
[1]
[1] > server
[1] > node ./server.js
[1]
[1] listening on http://localhost:1234
[0] console: [HPM] Proxy created: /oidc/  -> http://localhost:15000/
[0] Server running at http://localhost:1234
[0] Building...
[0] Building...
[0] Bundling...
[0] Packaging & Optimizing...
[0] ✨ Built in 633ms
@pamapa pamapa added the bug Something isn't working label Oct 28, 2022
@pamapa pamapa added this to the 2.1.1 milestone Oct 28, 2022
@pamapa pamapa closed this as completed Oct 28, 2022
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

2 participants