How to fix the error: Cannot find module 'next/dist/trace' when export next.js project
How to fix the error: Cannot find module 'next/dist/trace' when export next.js project
我正在使用 nx
和 next
进行开发,当我尝试 运行 npx nx export froentend
时,它会弹出如下错误,有人有什么想法吗?对了,我已经运行npx nx build froentend
提前了。
谢谢!
Error: Cannot find module 'next/dist/trace'
Require stack:
- ~/Code/lumos/lumos-dex-ui/node_modules/@nrwl/next/src/executors/export/export.impl.js
- ~/Code/lumos/lumos-dex-ui/node_modules/@nrwl/tao/src/shared/workspace.js
- ~/Code/lumos/lumos-dex-ui/node_modules/@nrwl/tao/src/commands/run.js
- ~/Code/lumos/lumos-dex-ui/node_modules/@nrwl/tao/index.js
- ~/Code/lumos/lumos-dex-ui/node_modules/@nrwl/cli/lib/run-cli.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/Users/rongliu/Code/lumos/lumos-dex-ui/node_modules/@nrwl/next/src/executors/export/export.impl.js:14:19)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1151:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:999:19)
因为我的next.js
版本太低,即v11
。升级lates后问题解决
我正在使用 nx
和 next
进行开发,当我尝试 运行 npx nx export froentend
时,它会弹出如下错误,有人有什么想法吗?对了,我已经运行npx nx build froentend
提前了。
谢谢!
Error: Cannot find module 'next/dist/trace'
Require stack:
- ~/Code/lumos/lumos-dex-ui/node_modules/@nrwl/next/src/executors/export/export.impl.js
- ~/Code/lumos/lumos-dex-ui/node_modules/@nrwl/tao/src/shared/workspace.js
- ~/Code/lumos/lumos-dex-ui/node_modules/@nrwl/tao/src/commands/run.js
- ~/Code/lumos/lumos-dex-ui/node_modules/@nrwl/tao/index.js
- ~/Code/lumos/lumos-dex-ui/node_modules/@nrwl/cli/lib/run-cli.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/Users/rongliu/Code/lumos/lumos-dex-ui/node_modules/@nrwl/next/src/executors/export/export.impl.js:14:19)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1151:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:999:19)
因为我的next.js
版本太低,即v11
。升级lates后问题解决