create-React-app returning error 'Cannot find module 'React-scripts/scripts/init.js' '

Asked

Viewed 338 times

0

When I try to create the React project with both npm and Yarn (create-React-app test), it returns the following error:

 internal/modules/cjs/loader.js:638
        throw err;
        ^

    Error: Cannot find module 'react-scripts/scripts/init.js'
        at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
        at Function.Module._load (internal/modules/cjs/loader.js:562:25)
        at Module.require (internal/modules/cjs/loader.js:690:17)
        at require (internal/modules/cjs/helpers.js:25:18)
        at [eval]:2:20
        at Script.runInThisContext (vm.js:122:20)
        at Object.runInThisContext (vm.js:329:38)
        at Object.<anonymous> ([eval]-wrapper:6:22)
        at Module._compile (internal/modules/cjs/loader.js:776:30)
        at evalScript (internal/bootstrap/node.js:589:27)

    Aborting installation.
      node  has failed.

    Deleting generated file... node_modules
    Deleting generated file... package.json
    Deleting generated file... yarn.lock
    Deleting teste/ from C:\Users\Laura\Documents\STUDY\React
    Done.

I uninstalled and installed a few times to make sure that everything would be updated, but I still have the same error.

Node -v : V10.16.0 || npm -v : 6.9.0 || Yarn -v : 1.16.0

  • What version of create-React-app? Windows, mac or linux operating system?

  • create-React-app 3.0.1 and Windows 10

  • Have you globally installed the create-React-app? In windows the global folder is in Appdata, removes everything from the pc and deletes the npm folders that is in Appdata and then tries again.

  • Yes, globally and I’ve reinstalled everything too :/

  • Tense, one output and you create the structure manually without scaffold, installing the React and the React-dom, configure all webpack plugins. Example

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.