Skip to content

Error "Module not found" for a private scoped npm package #12618

@msalafia

Description

@msalafia

I have installed a package from my private registry and imported my code in react. It is installed correctly because i can see the right folder in node_modules and the intellisense of my IDE correcly shows the info and files related to the package.

When i do npm start the console returns the error:

image

I tried to delete the folder node_modules, package-lock.json and i also did npm cache clean -f but nothing changed.

I noticed that if i downgrade react-scripts to a previous verison like 4.0.3 everything works correctly.

Environment

Environment Info:

  current version of create-react-app: 5.0.1
  running from /Users/marcosalafia/.npm/_npx/c67e74de0542c87c/node_modules/create-react-app

  System:
    OS: macOS 12.4
    CPU: (10) arm64 Apple M1 Pro
  Binaries:
    Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node
    Yarn: 1.22.15 - ~/.nvm/versions/node/v16.14.2/bin/yarn
    npm: 8.15.0 - ~/.nvm/versions/node/v16.14.2/bin/npm
  Browsers:
    Chrome: 103.0.5060.134
    Edge: Not Found
    Firefox: 101.0.1
    Safari: 15.5
  npmPackages:
    react: ^18.2.0 => 18.2.0 
    react-dom: ^18.2.0 => 18.2.0 
    react-scripts: 5.0.1 => 5.0.1 
  npmGlobalPackages:
    create-react-app: Not Found

Expected behavior

The private scoped npm packaged should be imported regularly like any other scoped npm package.

Actual behavior

The Module is not found.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions