找不到模块'react-dev-utils / crossSpawn'异常React App

时间:2018-11-01 08:19:32

标签: node.js reactjs phpstorm create-react-app

我下载了安装程序node-v10.6.0-x64和create-react-app-master软件包以用于React Application。在PhpStorm上创建React App项目后,我遇到了这样的异常:

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

Error: Cannot find module 'react-dev-utils/crossSpawn'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)
    at Function.Module._load (internal/modules/cjs/loader.js:506:25)
    at Module.require (internal/modules/cjs/loader.js:636:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (D:\Projects\ReactProjects\create-react-app-master\packages\react-scripts\bin\react-scripts.js:18:15)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ start: `cd packages/react-scripts && node bin/react-scripts.js start`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

我试图写PhpStorm终端:

npm install --save-dev react-dev-utils

但这没有帮助。

如何解决这个问题?

1 个答案:

答案 0 :(得分:4)

删除node_modules文件夹并运行“ npm install”。希望这会成功