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

使用forever启动报错 #6

Open
lcnwys opened this issue Jun 15, 2020 · 10 comments
Open

使用forever启动报错 #6

lcnwys opened this issue Jun 15, 2020 · 10 comments

Comments

@lcnwys
Copy link

lcnwys commented Jun 15, 2020

import createError = require('http-errors');
^^^^^^

SyntaxError: Unexpected token import
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:616:28)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:188:16)
at bootstrap_node.js:609:3
error: Forever detected script exited with code: 1

网易云项目可以使用forever启动,但是migu的不行,我看migu是app.ts,我在全局安装ts-node的时候报错无法安装,是不是这个原因,我已经先安装了 typescript 但是一直提示我 `-- UNMET PEER DEPENDENCY typescript@>=2.7

npm WARN ts-node@8.10.2 requires a peer of typescript@>=2.7 but none was installed.
没安装上ts-node,在网上也找不到解决办法,大神知道怎么解决么

@jsososo
Copy link
Owner

jsososo commented Jun 15, 2020 via email

@lcnwys
Copy link
Author

lcnwys commented Jun 15, 2020

我用npm全局安装的typescript 显示版本3.5

@jsososo
Copy link
Owner

jsososo commented Jun 15, 2020 via email

@lcnwys
Copy link
Author

lcnwys commented Jun 15, 2020

也是提示没有typescript 我卸载了typescript重新安装也还是不行,我查了库都有,好奇怪
C11E8B64-FFE0-4415-BF90-694ECDEF123C

@jsososo
Copy link
Owner

jsososo commented Jun 15, 2020 via email

@lcnwys
Copy link
Author

lcnwys commented Jun 15, 2020

找到一个解决办法
forever start -c "npm start" app.ts 居然可以

@jsososo
Copy link
Owner

jsososo commented Jun 16, 2020

emmm,所以是启动器的关系?我倒是没用过 forever 一直都是用pm2

@lcnwys
Copy link
Author

lcnwys commented Jun 16, 2020

emmm,所以是启动器的关系?我倒是没用过 forever 一直都是用pm2

我今天也改用 pm2 start npm --name test -- start 这样用npm启动就没问题啦

@lcnwys
Copy link
Author

lcnwys commented Jun 18, 2020

我很想知道为什么搜索Mijito查不到,却蹦出来迷迭香 >.<

@jsososo
Copy link
Owner

jsososo commented Jun 19, 2020 via email

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

2 participants