Skip to content

Error when creating a new project #2751

Closed
@SeanBannister

Description

@SeanBannister

Is this a bug report?

Yes

Can you also reproduce the problem with npm 4.x?

This bug is not reproducible with NPM. It only affects create-react-app when Yarn is installed.

Environment

  1. node -v: 6.11.0

  2. npm -v: 4.6.1

  3. yarn --version:
    Tested with:
    0.27.5
    0.26.0
    0.25.1

  4. npm ls react-scripts: Not applicable, doesn't get this far to check.

  5. Operating system:
    Windows 8.1 Pro

Steps to Reproduce

  1. Install create-react-app npm install -g create-react-app
  2. Install yarn via the windows .msi file.
  3. Open command prompt and run: create-react-app myapp

Expected Behavior

New project is created.

Actual Behavior

The following error is encountered.

Aborting installation.
Unexpected error. Please report it as a bug:
{ Error: Cannot find module 'L:\myapp\node_modules\react-scripts\scripts\init.js'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at getPackageName.then.then.then.packageName (C:\Users\Sean\AppData\Roaming\npm\node_modules\create-react-app\createReactApp.js:298:20)
    at process._tickCallback (internal/process/next_tick.js:109:7) code: 'MODULE_NOT_FOUND' }

Full output from the command line here.

As mentioned above this only happens when Yarn is installed and therefore create-react-app uses it for creating the project. If I uninstall Yarn the process completes successfully with NPM.

I'm looking for guidance on how I should attempt to debug this. This might end up being a Yarn issue.

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