svanderburg / node2nix

Generate Nix expressions to build NPM packages
MIT License
527 stars 100 forks source link

ENOENT: no such file or directory, open 'packages-lock.json' #260

Closed yuuyins closed 3 years ago

yuuyins commented 3 years ago

Expected

node2nix --nodejs-14 --lock packages-lock.json works

Happened

Got ENOENT: no such file or directory, open 'packages-lock.json'

Reproduce

  1. git clone https://github.com/apvarun/blist-hugo-theme.git
  2. cd blist-hugo-theme
  3. node2nix --nodejs-14 --lock packages-lock.json

Backtrace

node2nix --nodejs-14 --lock packages-lock.json
internal/fs/utils.js:314
    throw err;
    ^

Error: ENOENT: no such file or directory, open 'packages-lock.json'
    at Object.openSync (fs.js:498:3)
    at Object.readFileSync (fs.js:394:35)
    at Object.npmToNix (/nix/store/vhqrpibs729h5sf835bv8jhb12mm02nm-node2nix-1.9.0/lib/node_modules/node2nix/lib/node2nix.js:55:30)
    at Object.<anonymous> (/nix/store/vhqrpibs729h5sf835bv8jhb12mm02nm-node2nix-1.9.0/lib/node_modules/node2nix/bin/node2nix.js:261:10)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
    at Module.load (internal/modules/cjs/loader.js:937:32)
    at Function.Module._load (internal/modules/cjs/loader.js:778:12)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
    at internal/main/run_main_module.js:17:47 {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: 'packages-lock.json'
}

Info

yuuyins commented 3 years ago

node2nix --nodejs-14 --lock package-lock.json