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

[BUG] Referencing project in workspace when using npm create #6648

Closed
2 tasks done
aquacash5 opened this issue Jul 17, 2023 · 1 comment
Closed
2 tasks done

[BUG] Referencing project in workspace when using npm create #6648

aquacash5 opened this issue Jul 17, 2023 · 1 comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 9.x work is associated with a specific npm 9 release

Comments

@aquacash5
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

I have written a create templates tool for my workspace.

If I am at the root of my repository, I can run my npm create command and create a project from that template. However, I cannot use that command when I go deeper into my repo. It tells me not found in the registry.

Expected Behavior

Npm should check local repositories in the workspace before checking registry.npmjs.com for repositories.

Steps To Reproduce

  1. In my sample project https://github.com/aquacash5/create-problem
  2. Run npm create @problem in the root of the workspace
    • This shows that the command is expected to work and works in the root of the workspace
  3. Run npm create @problem in the cloudflare directory
    • This shows that it fails any deeper in the workspace
  4. See error...
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@problem%2fcreate - Not found
npm ERR! 404 
npm ERR! 404  '@problem/create@*' is not in this registry.
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in: ...

Environment

  • npm: 9.8.0
  • Node.js: 20.3.1
  • OS Name: Fedora 38
  • System Model Name: Custom PC
  • npm config:
; "user" config from /home/<USER>/.npmrc

@synergy:registry = "https://npm.pkg.github.com/" 
//npm.pkg.github.com/:_authToken = (protected) 
//registry.npmjs.org/:_authToken = (protected) 

; node bin location = /home/<USER>/.local/share/fnm/node-versions/v20.3.1/installation/bin/node
; node version = v20.3.1
; npm local prefix = /run/media/<USER>/Personal/github/create-problem
; npm version = 9.8.0
; cwd = /run/media/<USER>/Personal/github/create-problem/cloudflare
; HOME = /home/<USER>
; Run `npm config ls -l` to show all defaults.
@aquacash5 aquacash5 added Bug thing that needs fixing Needs Triage needs review for next steps Release 9.x work is associated with a specific npm 9 release labels Jul 17, 2023
@aquacash5 aquacash5 changed the title [BUG] Reference project in workspace when using npm create [BUG] Referencing project in workspace when using npm create Jul 17, 2023
@milaninfy
Copy link
Contributor

This appears similer if not duplicate of #7700 which is fixed by #7721.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 9.x work is associated with a specific npm 9 release
Projects
None yet
Development

No branches or pull requests

2 participants