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

After recent updates I cant fix lockfile in when package version is a link to tar #7368

Closed
2 of 4 tasks
CONMTKT opened this issue Dec 1, 2023 · 0 comments · Fixed by #7404
Closed
2 of 4 tasks

After recent updates I cant fix lockfile in when package version is a link to tar #7368

CONMTKT opened this issue Dec 1, 2023 · 0 comments · Fixed by #7404

Comments

@CONMTKT
Copy link

CONMTKT commented Dec 1, 2023

Verify latest release

  • I verified that the issue exists in the latest pnpm release

pnpm version

8.11.0

Which area(s) of pnpm are affected? (leave empty if unsure)

Lockfile

Link to the code that reproduces this issue or a replay of the bug

No response

Reproduction steps

Follow the steps below to replicate the issue:

11:41 $ mkdir testPnpm
11:41 $ cd testPnpm/
11:41 $ pnpm init
Wrote to /Users/conmtkt/repo/testPnpm/package.json

{
  "name": "testPnpm",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC"
}
11:41 $ pnpm add xlsx@https://cdn.sheetjs.com/xlsx-0.18.9/xlsx-0.18.9.tgz
Packages: +1
+
Progress: resolved 1, reused 1, downloaded 0, added 1, done

dependencies:
+ xlsx 0.18.9

Done in 402ms

11:42 $ cat package.json 
{
  "name": "testPnpm",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "xlsx": "https://cdn.sheetjs.com/xlsx-0.18.9/xlsx-0.18.9.tgz"
  }
}
11:42 $ pnpm i
Lockfile is up to date, resolution step is skipped
Already up to date
Done in 332ms
11:42 $ pnpm i --fix-lockfile
 ERROR  Cannot read properties of undefined (reading '0')

pnpm: Cannot read properties of undefined (reading '0')
    at pkgSnapshotToResolution (/Users/conmtkt/.nvm/versions/node/v18.17.1/lib/node_modules/pnpm/dist/pnpm.cjs:111869:28)
    at getInfoFromLockfile (/Users/conmtkt/.nvm/versions/node/v18.17.1/lib/node_modules/pnpm/dist/pnpm.cjs:180444:101)
    at getDepsToResolve (/Users/conmtkt/.nvm/versions/node/v18.17.1/lib/node_modules/pnpm/dist/pnpm.cjs:180379:34)
    at /Users/conmtkt/.nvm/versions/node/v18.17.1/lib/node_modules/pnpm/dist/pnpm.cjs:180005:96
    at Array.map (<anonymous>)
    at resolveDependenciesOfImporters (/Users/conmtkt/.nvm/versions/node/v18.17.1/lib/node_modules/pnpm/dist/pnpm.cjs:180005:55)
    at resolveRootDependencies (/Users/conmtkt/.nvm/versions/node/v18.17.1/lib/node_modules/pnpm/dist/pnpm.cjs:179967:80)
    at resolveDependencyTree (/Users/conmtkt/.nvm/versions/node/v18.17.1/lib/node_modules/pnpm/dist/pnpm.cjs:180916:105)
    at resolveDependencies (/Users/conmtkt/.nvm/versions/node/v18.17.1/lib/node_modules/pnpm/dist/pnpm.cjs:182306:211)
    at async _installInContext (/Users/conmtkt/.nvm/versions/node/v18.17.1/lib/node_modules/pnpm/dist/pnpm.cjs:185679:238)
11:42 $ 

Describe the Bug

If lockfile contains a package that has a version set to a link to tar.gz file then pnpm i --fix-lockfile always fails

Expected Behavior

No failure when running pnpm i --fix-lockfile

Which Node.js version are you using?

v18.17.1

Which operating systems have you used?

  • macOS
  • Windows
  • Linux

If your OS is a Linux based, which one it is? (Include the version if relevant)

No response

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

Successfully merging a pull request may close this issue.

1 participant