报错某个文件打不开,有可能是文件权限不足。报错如下
D:\Users\whh\Desktop\my-next-2>yarn build
yarn run v1.22.19
$ next build
uncaughtException [Error: EPERM: operation not permitted, open 'D:\Users\whh\Desktop\my-next-2\.next\trace'] {
errno: -4048,
code: 'EPERM',
syscall: 'open',
path: 'D:\\Users\\whh\\Desktop\\my-next-2\\.next\\trace'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
解决办法赋予权限
1、用管理员权限打开cmd进行打包
2、更改文件权限
给当前登录的用户完全控制就好