创建插件plugin-hello报no such file or directory,

按文档上执行 yarn pm create @my-project/plugin-hello 命令,前面都执行成功了,到最后阶段报错:


D:\project\nocobase-main>yarn pm create @my-project/plugin-hello
yarn run v1.22.22
$ nocobase pm create @my-project/plugin-hello
WAIT: TypeScript compiling...
2024-11-25 22:34:42 [debug] create database instance: {"sync":{"alter":{"drop":false},"force":false},"logging":false,"dialect":"mysql","username":"root","database":"nocobase","port":"3306","timezone":"+08:00","tablePrefix":"","underscored":false,"migrator":{"context":{"app":{"appName":"main","name":"main"}}},"logger":{}} meta={"databaseInstanceId":"UsYdlCmqdoraDouuyX6_J"} module=database app=main reqId=834ec25c-0cff-4e16-8006-ae2b8ca4ea33 dataSourceKey=main
2024-11-25 22:34:43 [info]  add app main into supervisor                 module=application submodule=supervisor method=addApp app=main reqId=834ec25c-0cff-4e16-8006-ae2b8ca4ea33 dataSourceKey=main
Creating plugin
Write: packages\plugins\@my-project\plugin-hello\.npmignore
Copy:  client.d.ts
Copy:  client.js
Write: packages\plugins\@my-project\plugin-hello\package.json
Write: packages\plugins\@my-project\plugin-hello\README.md
Copy:  server.d.ts
Copy:  server.js
Copy:  src/client/client.d.ts
Write: packages\plugins\@my-project\plugin-hello\src\client\index.tsx
Copy:  src/client/locale.ts
Copy:  src/index.ts
Copy:  src/locale/en-US.json
Copy:  src/locale/zh-CN.json
Copy:  src/server/collections/.gitkeep
Write: packages\plugins\@my-project\plugin-hello\src\server\index.ts
Write: packages\plugins\@my-project\plugin-hello\src\server\plugin.ts

$ nocobase postinstall --skip-umi
[Error: EPERM: operation not permitted, symlink 'D:\project\nocobase-main\packages\plugins\@my-project\plugin-hello' -> 'D:\project\nocobase-main\node_modules\@my-project\plugin-hello'] {
  errno: -4048,
  code: 'EPERM',
  syscall: 'symlink',
  path: 'D:\\project\\nocobase-main\\packages\\plugins\\@my-project\\plugin-hello',
  dest: 'D:\\project\\nocobase-main\\node_modules\\@my-project\\plugin-hello'
}
The plugin folder is in packages/plugins/@my-project/plugin-hello
2024-11-25 22:34:45 [info]  connection has been established successfully. module=database method=auth app=main reqId=834ec25c-0cff-4e16-8006-ae2b8ca4ea33 dataSourceKey=main
2024-11-25 22:34:45 [info]  attempt to add the plugin to the app         module=application app=main reqId=834ec25c-0cff-4e16-8006-ae2b8ca4ea33 dataSourceKey=main
2024-11-25 22:34:45 [error] ENOENT: no such file or directory, realpath 'D:\project\nocobase-main\node_modules\@my-project\plugin-hello\package.json' stack=Error: ENOENT: no such file or directory, realpath 'D:\project\nocobase-main\node_modules\@my-project\plugin-hello\package.json' module=application app=main reqId=834ec25c-0cff-4e16-8006-ae2b8ca4ea33 dataSourceKey=main
Done in 18.07s.

然后 在本地插件里 找不到 @my-project\plugin-hello 插件

已经解决,用管理员方式打开CMD 运行命令就行了