nuxt dev编译报错Cannot find module ‘node:util‘

错误:
Require stack:

  • node_modules@nuxt\friendly-errors-webpack-plugin\node_modules\consola\dist\shared\consola.deac7d5a.cjs
  • node_modules@nuxt\friendly-errors-webpack-plugin\node_modules\consola\dist\shared\consola.4bbae468.cjs
  • node_modules@nuxt\friendly-errors-webpack-plugin\node_modules\consola\dist\index.cjs
  • node_modules@nuxt\friendly-errors-webpack-plugin\node_modules\consola\lib\index.cjs
  • node_modules@nuxt\friendly-errors-webpack-plugin\src\reporters\consola.js
  • node_modules@nuxt\friendly-errors-webpack-plugin\src\friendly-errors-plugin.js
  • node_modules@nuxt\friendly-errors-webpack-plugin\index.js
  • node_modules@nuxt\webpack\dist\webpack.js
  • node_modules@nuxt\builder\dist\builder.js
  • index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object. (node_modules@nuxt\friendly-errors-webpack-plugin\node_modules\consola\dist\shared\consola.deac7d5a.cjs:3:19)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions…js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)

在npm run dev下报错,原因未明。
怀疑是nuxt版本问题:
1、先清理:
npm cache clean --force
然后
安装:
npm install [email protected]
报错:
npm run dev 报 FATAL pattern.replace is not a function
再升级
直到升级到
npm install [email protected]
再次编译成功。

你可能感兴趣的:(环境搭建专栏,npm,es6,vue.js,node.js)