MiguMusicApi icon indicating copy to clipboard operation
MiguMusicApi copied to clipboard

npm install后使用npm start启动失败

Open AffectionParadise opened this issue 3 years ago • 8 comments

显示如下信息

rm -rf ./dist && tsc && tsc-alias && node build.js && cp -r -f ./views ./dist/views && cp -r -f ./public ./dist/public

'rm' 不是内部或外部命令,也不是可运行的程序 或批处理文件。

AffectionParadise avatar Jan 20 '22 14:01 AffectionParadise

windows没有 相关命令的话可以查一下具体的替代命令,我这边也不是很清楚

jsososo avatar Jan 20 '22 14:01 jsososo

可以用这个命令替代,rimraf需要npm 安装一下,Xcopy是windows命令: "build": "rimraf ./dist && tsc && tsc-alias && node build.js && Xcopy .\views .\dist\views /E/H/C/I && Xcopy .\public .\dist\public /E/H/C/I",

jayteen avatar May 03 '22 04:05 jayteen

我也遇到了同样的问题

root@VM-24-15-ubuntu:~/github/KO-ON-Bot/MiguMusicApi# npm start

> [email protected] start
> npm run build && node bin/www


> [email protected] build
> rm -rf ./dist && tsc && tsc-alias && node build.js && cp -r -f ./views ./dist/views && cp -r -f ./public ./dist/public

util/type.ts:118:15 - error TS2842: 'Rec' is an unused renaming of 'query'. Did you intend to use it as a type annotation?

118     ({ query: Rec, res: ResType }): Promise<ResponseData | boolean>
                  ~~~

  util/type.ts:118:34
    118     ({ query: Rec, res: ResType }): Promise<ResponseData | boolean>
                                         ~
    We can only write a type for 'query' by adding a type for the entire parameter here.

util/type.ts:118:25 - error TS2842: 'ResType' is an unused renaming of 'res'. Did you intend to use it as a type annotation?

118     ({ query: Rec, res: ResType }): Promise<ResponseData | boolean>
                            ~~~~~~~

  util/type.ts:118:34
    118     ({ query: Rec, res: ResType }): Promise<ResponseData | boolean>
                                         ~
    We can only write a type for 'res' by adding a type for the entire parameter here.


Found 2 errors in the same file, starting at: util/type.ts:118

npm版本是8.3.1 node版本是v16.14.0

yishuiwang avatar Nov 01 '22 15:11 yishuiwang

我也遇到了同样的问题

root@VM-24-15-ubuntu:~/github/KO-ON-Bot/MiguMusicApi# npm start

> [email protected] start
> npm run build && node bin/www


> [email protected] build
> rm -rf ./dist && tsc && tsc-alias && node build.js && cp -r -f ./views ./dist/views && cp -r -f ./public ./dist/public

util/type.ts:118:15 - error TS2842: 'Rec' is an unused renaming of 'query'. Did you intend to use it as a type annotation?

118     ({ query: Rec, res: ResType }): Promise<ResponseData | boolean>
                  ~~~

  util/type.ts:118:34
    118     ({ query: Rec, res: ResType }): Promise<ResponseData | boolean>
                                         ~
    We can only write a type for 'query' by adding a type for the entire parameter here.

util/type.ts:118:25 - error TS2842: 'ResType' is an unused renaming of 'res'. Did you intend to use it as a type annotation?

118     ({ query: Rec, res: ResType }): Promise<ResponseData | boolean>
                            ~~~~~~~

  util/type.ts:118:34
    118     ({ query: Rec, res: ResType }): Promise<ResponseData | boolean>
                                         ~
    We can only write a type for 'res' by adding a type for the entire parameter here.


Found 2 errors in the same file, starting at: util/type.ts:118

npm版本是8.3.1 node版本是v16.14.0

我也遇到同样的问题了,你是怎么解决的? @jsososo @yishuiwang

robotsp avatar Nov 03 '22 08:11 robotsp

还没解决 @robotsp

yishuiwang avatar Nov 03 '22 15:11 yishuiwang

还没解决 @robotsp

其实,那个命令就是把public和views文件夹复制进dist,你可以手动操作然后把那个命令删除就可以了,这个解决方法我也是后来发现的

AffectionParadise avatar Nov 03 '22 15:11 AffectionParadise

这个命令在哪删除呢

Huangfarong avatar Dec 13 '22 11:12 Huangfarong

webstorm提示,使用@ts-ignore 禁止。 位置:MiguMusicApi-master\util\type.ts 修改后的代码如下

export interface RouteFunc {
    // @ts-ignore
    ({ query: Rec, res: ResType }): Promise<ResponseData | boolean>
  }

然后我尝试在服务器运行,成功

KISGP avatar Dec 14 '22 10:12 KISGP