Node.js 混合时导致错误的节点模块安装

Node.js 混合时导致错误的节点模块安装,node.js,laravel,webpack,Node.js,Laravel,Webpack,我有一个运行在laravel上的服务器,我想在其中添加一个名为“NodeEmailer”的节点模块。但每当我在后台运行npm run watch或npm run dev时,如果我安装“nodeEmailer”,就会显示错误。 错误: ERROR in ./node_modules/@babel/runtime/regenerator/index.js Module build failed: Error: ENOENT: no such file or directory, open '/Use

我有一个运行在laravel上的服务器,我想在其中添加一个名为“NodeEmailer”的节点模块。但每当我在后台运行
npm run watch
npm run dev
时,如果我安装“nodeEmailer”,就会显示错误。 错误:

ERROR in ./node_modules/@babel/runtime/regenerator/index.js
Module build failed: Error: ENOENT: no such file or directory, open '/Users/****/projects/githubs/####/node_modules/@babel/runtime/regenerator/index.js'
 @ ./resources/js/index.js 1:0-61 24:4-23 26:13-32 100:4-23 102:13-32 160:4-23 161:13-32 186:4-23 187:13-32 216:4-23 218:13-32 257:4-23 260:13-32 306:4-23 309:13-32 355:4-23 358:13-32 399:4-23 402:13-32 442:4-23 445:13-32 493:4-23 496:13-32 535:4-23 538:13-32 580:4-23 582:13-32 618:4-23 620:13-32 657:4-23 659:13-32
 @ multi ./resources/js/index.js

ERROR in ./node_modules/process/browser.js
Module build failed: Error: ENOENT: no such file or directory, open '/Users/****/projects/githubs/####/node_modules/process/browser.js'
 @ ./node_modules/axios/lib/defaults.js 1:0-37
 @ ./node_modules/axios/lib/axios.js
 @ ./node_modules/axios/index.js
 @ ./resources/js/bootstrap.js
 @ ./resources/js/app.js
 @ multi ./resources/js/app.js

ERROR in ./node_modules/timers-browserify/main.js
Module build failed: Error: ENOENT: no such file or directory, open '/Users/****/projects/githubs/####/node_modules/timers-browserify/main.js'
 @ ./node_modules/vue/dist/vue.common.dev.js 1:0-44
 @ ./node_modules/vue/dist/vue.common.js
 @ ./resources/js/app.js
 @ multi ./resources/js/app.js

ERROR in ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
Module build failed: Error: ENOENT: no such file or directory, open '/Users/****/projects/githubs/####/node_modules/vue-loader/lib/runtime/componentNormalizer.js'
 @ ./resources/js/components/ExampleComponent.vue 7:0-93 8:16-26
 @ ./resources/js/app.js
 @ multi ./resources/js/app.js

ERROR in ./node_modules/web3/dist/web3.umd.js
Module build failed: Error: ENOENT: no such file or directory, open '/Users/****/projects/githubs/####/node_modules/web3/dist/web3.umd.js'
 @ ./resources/js/index.js 7:0-43 700:19-23 705:19-23 705:28-32
 @ multi ./resources/js/index.js

ERROR in (webpack)/buildin/global.js
Module build failed: Error: ENOENT: no such file or directory, open '/Users/****/projects/githubs/####/node_modules/webpack/buildin/global.js'
 @ ./node_modules/lodash/lodash.js 1:0-41
 @ ./resources/js/bootstrap.js
 @ ./resources/js/app.js
 @ multi ./resources/js/app.js

ERROR in (webpack)/buildin/module.js
Module build failed: Error: ENOENT: no such file or directory, open '/Users/****/projects/githubs/####/node_modules/webpack/buildin/module.js'
 @ ./node_modules/lodash/lodash.js 1:0-41
 @ ./resources/js/bootstrap.js
 @ ./resources/js/app.js
 @ multi ./resources/js/app.js

我已经尝试过使用Thread进行安装,它说节点引擎需要一个较旧的版本,但当我仅为此模块打开一个空文件时,它就工作了。请执行以下步骤:

  • 停止监视脚本(如果正在运行)
  • 运行
    rm-rf node\u modules package lock.json
    以消除任何旧的、可能已损坏的依赖项
  • 运行
    npm install
    ,从头开始干净地安装所有内容
  • 再次运行代码

假设您需要的所有依赖项都已注册到
package.json文件中(并且您的代码是正确的),那么现在应该可以正常工作了。

执行以下步骤:

  • 停止监视脚本(如果正在运行)
  • 运行
    rm-rf node\u modules package lock.json
    以消除任何旧的、可能已损坏的依赖项
  • 运行
    npm install
    ,从头开始干净地安装所有内容
  • 再次运行代码

假设您需要的所有依赖项都注册在
package.json
文件中(并且您的代码是正确的),现在一切正常。

尝试npm安装或将节点降级到该旧版本,然后再次安装npm。尝试npm安装或将节点降级到该旧版本,然后再次安装npm。但我不确定是否所有依赖项都在package.json文件中。有没有办法列出package.json文件中的所有模块?但我不确定是否所有依赖项都在package.json文件中。有没有办法列出package.json文件中的所有模块?