MiguMusicApi
MiguMusicApi copied to clipboard
npm install后使用npm start启动失败
显示如下信息
rm -rf ./dist && tsc && tsc-alias && node build.js && cp -r -f ./views ./dist/views && cp -r -f ./public ./dist/public
'rm' 不是内部或外部命令,也不是可运行的程序 或批处理文件。
windows没有 相关命令的话可以查一下具体的替代命令,我这边也不是很清楚
可以用这个命令替代,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",
我也遇到了同样的问题
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
我也遇到了同样的问题
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
还没解决 @robotsp
其实,那个命令就是把public和views文件夹复制进dist,你可以手动操作然后把那个命令删除就可以了,这个解决方法我也是后来发现的
这个命令在哪删除呢
webstorm提示,使用@ts-ignore 禁止。 位置:MiguMusicApi-master\util\type.ts 修改后的代码如下
export interface RouteFunc {
// @ts-ignore
({ query: Rec, res: ResType }): Promise<ResponseData | boolean>
}
然后我尝试在服务器运行,成功