swordjs / sword-framework

A small and flexible for serverless nodejs framework 💗
25 stars 3 forks source link

no such file or directory, mkdir #10

Closed linyu520 closed 2 years ago

linyu520 commented 2 years ago

创建版本"1.2.11",并且pnpm i 后,直接执行sword dev,报以下错误,无法开启! ENOENT: no such file or directory, mkdir errno: -4058, syscall: 'mkdir', code: 'ENOENT'

seho-dev commented 2 years ago

是windows 还是mac os

seho-dev commented 2 years ago

你尝试使用最新版本的cli和框架版本, 使用cli生成一个最新版本的project试一下

seho-dev commented 2 years ago

提供一下nodejs版本

LinYu520312 commented 2 years ago

提供一下nodejs版本

node版本:v17.1.0

LinYu520312 commented 2 years ago

是windows 还是mac os

windows

LinYu520312 commented 2 years ago

用最新版本的cli和框架版本

sword版本为"@swordjs/sword-framework": "1.4.0",项目版本为1.2.11

seho-dev commented 2 years ago

升级到最新版本吧, cli现在最新是1.5.3, 升级之后再创建一个项目

seho-dev commented 2 years ago

https://www.npmjs.com/package/@swordjs/sword-framework-cli

LinYu520312 commented 2 years ago

https://www.npmjs.com/package/@swordjs/sword-framework-cli 无法更新到最新版本 No matching version found for @swordjs/sword-framework@1.5.3

seho-dev commented 2 years ago

你重新全局装一遍, 就是最新版本, 你是用yarn/pnpm/npm?

linyu520 commented 2 years ago

你重新全局装一遍, 就是最新版本, 你是用yarn/pnpm/npm?

有重新全局安装,结果还是1.4.0版本!npm

seho-dev commented 2 years ago

卸载重新装吧, 我看npm上最新的是1.5.3, 可能是你内部源的问题导致没办法升级

linyu520 commented 2 years ago

卸载重新装吧, 我看npm上最新的是1.5.3, 可能是你内部源的问题导致没办法升级

{ "name": "@swordjs/sword-framework-example", "version": "1.2.11", "description": "this is a sword framework example", "publishConfig": { "access": "public", "registry": "https://registry.npmjs.org/" }, "author": "", "license": "ISC", "dependencies": { "@swordjs/sword-framework": "1.4.0" }, "devDependencies": { "@dcloudio/types": "^2.6.6", "@swordjs/sword-framework-cli": "1.5.3", "@types/node": "^17.0.24", "typescript": "^4.6.3" }, "scripts": { "dev": "sword dev", "dev:unicloud": "sword dev --platform=unicloud", "build": "sword build", "build:unicloud": "sword build --platform=unicloud", "server": "cd ./.sword/build/server && node ./src/index.js", "doc": "sword doc" } }

刚看错了,cli已经是最新版本,是"@swordjs/sword-framework": "1.4.0"! 你看这样是最新的吗?我刚刚重新创建了一下,还是一样报错!

seho-dev commented 2 years ago

脚手架你全局装过么; 这个报错是脚手架的报错, 不是框架runtime的报错; 我这边复现一下, 稍等

linyu520 commented 2 years ago

最新

有全局安装,按照语雀上的文档npm i @swordjs/sword-framework-cli -g

seho-dev commented 2 years ago

我刚刚调整了一下, 你需要重新安装一下全局脚手架, 这样

npm i @swordjs/sword-framework-cli -g-dev

然后你重新创建一个最新版本的空项目 (刚刚我迭代了一次demo的版本) 然后你再试试.

image

image

seho-dev commented 2 years ago

具体的版本和文档说明, 我晚点补齐, 如果还有问题的话, 我可能得晚点回复你

linyu520 commented 2 years ago

我是这么操作的! 1:全局重新安装npm i @swordjs/sword-framework-cli -g-dev 2:sword init 选择1.2.12项目版本

  1. 打开项目package.json,发现缺少了 "@swordjs/sword-framework-cli": "^1.5.3" `{ "dependencies": { "@swordjs/sword-framework": "1.4.0" },

"devDependencies": { "@dcloudio/types": "^2.6.6", "@swordjs/h3": "0.7.6", "@types/node": "^17.0.24", "typescript": "^4.6.3" } }`

  1. 重新在项目执行pnpm i @swordjs/sword-framework-cli --save-dev安装
  2. sword dev后,依然报错!同样的错误
  3. 然后我整个脚手架卸载了,重新全局安装,重新创建项目,依然如上诉问题
seho-dev commented 2 years ago

你不需要在项目里面重新安装cli, 仅仅全局安装就可以了; 那就奇怪了, 难道是node版本, 或者你加我一个微信, 我想看看视频, 这个问题很奇怪

seho-dev commented 2 years ago

问题已经解决了, 原因是用户执行命令时不在根目录; 对其他已知问题已经做出来修复, 详见: https://github.com/swordjs/sword-framework/blob/master/packages/cli/CHANGELOG.md#154

seho-dev commented 2 years ago

1.5.5-alpha.1已解决os兼容问题