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

when install from node_modules, "name"/"dependencies" in package.json should not be used #311

Open
GongT opened this issue Jul 13, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@GongT
Copy link

GongT commented Jul 13, 2023

reproduce steps:

  1. install in a empty dir:
    corepack npm install --save react@npm:preact jspm
  2. run jspm:
    jspm "install" "--provider" "nodemodules" "react"

result:

Error: file:///tmp/qqq/node_modules/preact does not exist, try installing "preact" with npm first via "npm install preact".

source:

https://github.com/jspm/generator/blob/11475a5f47e18a72b38f1860c110dd7fe4d12ef4/src/install/package.ts#L219C13-L219C13

detail:

The new jspm do not download anything to local filesystem, version (or url) of a package doesn't seem to make sense.

I also see some code (many come from 2 years ago) is reading "name" field in package.json, I think they are "happens to be ok".

@guybedford
Copy link
Member

This is because JSPM generator does not respect the "react" alias when doing an install from the nodemodules provider.

If you instead fo jspm install --provider nodemodules react=preact it will work correctly in this case I believe.

@guybedford guybedford added the bug Something isn't working label Jul 31, 2023
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