Router.use() requires a middleware function but got a Object
电脑重装系统进行数据迁移,为节省空间删除了 node_modules 文件。而后重装 npm install 后无法运行。
使用的是全局安装的 express-generator@4,其余部分未作任何更改。
会不会是 express-generator 不会自动创建 package.lock.json 导致重新安装时出现了版本兼容方面的错误啊?恳请各位大佬帮忙看看。
完整日志信息在这里
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\myCommonTools\\NodeJS\\node.exe',
1 verbose cli 'C:\\myCommonTools\\NodeJS\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'start'
1 verbose cli ]
2 info using npm@6.12.0
3 info using node@v12.13.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle service@0.0.0~prestart: service@0.0.0
6 info lifecycle service@0.0.0~start: service@0.0.0
7 verbose lifecycle service@0.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle service@0.0.0~start: PATH: C:\myCommonTools\nvm\v12.13.0\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:\CodeStore\find_toilet\service\node_modules\.bin;C:\myCommonTools\Cmder\bin;C:\myCommonTools\Cmder\vendor\bin;C:\myCommonTools\Cmder\vendor\conemu-maximus5\ConEmu\Scripts;C:\myCommonTools\Cmder\vendor\conemu-maximus5;C:\myCommonTools\Cmder\vendor\conemu-maximus5\ConEmu;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\myCommonTools\nvm;C:\myCommonTools\NodeJS;C:\myCommonTools\Git\cmd;C:\Users\fatewang\AppData\Local\Microsoft\WindowsApps;C:\myCommonTools\Microsoft VS Code\bin;C:\myCommonTools\Bandizip\;C:\Users\fatewang\AppData\Roaming\npm;C:\myCommonTools\nvm;C:\myCommonTools\NodeJS;C:\myCommonTools\Git\cmd;C:\myCommonTools\Git\mingw64\bin;C:\myCommonTools\Git\usr\bin;C:\myCommonTools\Cmder
9 verbose lifecycle service@0.0.0~start: CWD: D:\CodeStore\find_toilet\service
10 silly lifecycle service@0.0.0~start: Args: [ '/d /s /c', 'node ./bin/www' ]
11 silly lifecycle service@0.0.0~start: Returned: code: 1 signal: null
12 info lifecycle service@0.0.0~start: Failed to exec start script
13 verbose stack Error: service@0.0.0 start: `node ./bin/www`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\myCommonTools\nvm\v12.13.0\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:210:5)
13 verbose stack at ChildProcess.<anonymous> (C:\myCommonTools\nvm\v12.13.0\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:210:5)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid service@0.0.0
15 verbose cwd D:\CodeStore\find_toilet\service
16 verbose Windows_NT 10.0.18362
17 verbose argv "C:\\myCommonTools\\NodeJS\\node.exe" "C:\\myCommonTools\\NodeJS\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v12.13.0
19 verbose npm v6.12.0
20 error code ELIFECYCLE
21 error errno 1
22 error service@0.0.0 start: `node ./bin/www`
22 error Exit status 1
23 error Failed at the service@0.0.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论