Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm install后使用npm start启动失败 #23

Open
AffectionParadise opened this issue Jan 20, 2022 · 8 comments
Open

npm install后使用npm start启动失败 #23

AffectionParadise opened this issue Jan 20, 2022 · 8 comments

Comments

@AffectionParadise
Copy link

显示如下信息

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

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

@jsososo
Copy link
Owner

jsososo commented Jan 20, 2022 via email

@jayteen
Copy link

jayteen commented May 3, 2022

可以用这个命令替代,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",

@yishuiwang
Copy link

我也遇到了同样的问题

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

> migu-music-api@1.0.1 start
> npm run build && node bin/www


> migu-music-api@1.0.1 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

@robotsp
Copy link

robotsp commented Nov 3, 2022

我也遇到了同样的问题

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

> migu-music-api@1.0.1 start
> npm run build && node bin/www


> migu-music-api@1.0.1 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

@yishuiwang
Copy link

还没解决 @robotsp

@AffectionParadise
Copy link
Author

还没解决 @robotsp

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

@KISGP
Copy link

KISGP commented Dec 14, 2022

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

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants
@robotsp @jsososo @jayteen @AffectionParadise @yishuiwang @KISGP and others