Skip to content

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

@aquacash5

Description

@aquacash5

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next stepsRelease 9.xwork is associated with a specific npm 9 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions