使用npx create-react-app my-app时出错

时间:2020-10-29 10:10:25

标签: reactjs

使用npx create-react-app my-app时遇到错误,以下是我的错误代码: npm版本是14,我也尝试过12,但仍然遇到此错误。还禁用了我的防病毒软件

error C:\Users\Gringo-PC\Documents\vvv\my-app\node_modules\ejs: Command failed.
Exit code: 1
Command: node ./postinstall.js
Arguments:
Directory: C:\Users\Gringo-PC\Documents\vvv\my-app\node_modules\ejs
Output:
internal/modules/cjs/loader.js:797
    throw err;

Error: Cannot find module 'C:\Users\Gringo-PC\Documents\vvv\my-app\node_modules\ejs\postinstall.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:794:15)
    at Function.Module._load (internal/modules/cjs/loader.js:687:27)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1025:10)
    at internal/main/run_main_module.js:17:11 {
  code: 'MODULE_NOT_FOUND',

这可能是什么问题?

1 个答案:

答案 0 :(得分:0)

我已解决此问题,方法是删除位于AppData \ Roaming中的所有npm文件夹,然后重新安装nodejs。