npm run start
报错,而使用npm run dev
没问题开发电脑使用的window 7,习惯使用系统自带的cmd
执行相关命令,抛出如下错误:
[egg-scripts] Run node D:\project\imqianduan.com\node_modules\egg-scripts\lib\start-cluster {"port":7000,"title":"egg-server-imqianduan.com","framework":"D:\\project\\imqianduan.com\\node_modules\\egg","baseDir":"D:\\project\\imqianduan.com"} --title=egg-server-imqianduan.com
[egg-scripts] Save log file to C:\Users\88888\logs
[egg-scripts] Wait Start: 1...
[egg-scripts] Wait Start: 2...
[egg-scripts] Wait Start: 3...
[egg-scripts] Wait Start: 4...
[egg-scripts] Wait Start: 5...
[egg-scripts] Wait Start: 6...
[egg-scripts] tail -n 100 C:\Users\88888\logs\master-stderr.log
[egg-scripts] ignore tail error: Error: spawn tail ENOENT
[egg-scripts] Start got error, see C:\Users\88888\logs\master-stderr.log
[egg-scripts] Or use `--ignore-stderr` to ignore stderr at startup.
依建议,取消了--ignore-stderr
了,重新启动npm run start
貌似也没有启动成功,也没有具体的错误提示
[egg-scripts] Run node D:\project\imqianduan.com\node_modules\egg-scripts\lib\start-cluster {"port":7000,"title":"egg-server-imqianduan.com","framework":"D:\\project\\imqianduan.com\\node_modules\\egg","baseDir":"D:\\project\\imqianduan.com"} --title=egg-server-imqianduan.com
[egg-scripts] Save log file to C:\Users\88888\logs
[egg-scripts] Wait Start: 1...
[egg-scripts] Wait Start: 2...
[egg-scripts] Wait Start: 3...
[egg-scripts] Wait Start: 4...
[egg-scripts] Wait Start: 5...
[egg-scripts] Wait Start: 6...
[egg-scripts] tail -n 100 C:\Users\88888\logs\master-stderr.log
[egg-scripts] ignore tail error: Error: spawn tail ENOENT
[egg-scripts] Start got error, see C:\Users\88888\logs\master-stderr.log
[egg-scripts] Or use `--ignore-stderr` to ignore stderr at startup.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! imqianduan.com@1.0.0 start: `egg-scripts start --daemon --port 7000`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the imqianduan.com@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\88888\AppData\Roaming\npm-cache\_logs\2018-10-12T10_52_13_219Z-debug.log
通过上面可以看到,有一个错误spawn tail ENOENT
,start没有启动成功,什么原因呢?
百度出来各种重复的答复的,解决不了问题。google spawn tail ENOENT
第一条
https://github.com/mthenw/frontail/issues/81,启发是不是cmd的问题?
npm run start
牛逼了,错误信息出来了,很明显,redis密码错误
[egg-scripts] Run node D:\project\imqianduan.com\node_modules\egg-scripts\lib\start-cluster {"port":7000,"title":"egg-server-imqianduan.com","framework":"D:\\project\\imqianduan.com\\node_modules\\egg","baseDir":"D:\\project\\imqianduan.com"} --title=egg-server-imqianduan.com
[egg-scripts] Save log file to C:\Users\88888\logs
[egg-scripts] Wait Start: 1...
[egg-scripts] Wait Start: 2...
[egg-scripts] Wait Start: 3...
[egg-scripts] Wait Start: 4...
[egg-scripts] Wait Start: 5...
[egg-scripts] tail -n 100 C:\Users\88888\logs\master-stderr.log
[egg-scripts] Got error when startup:
[egg-scripts] 2018-10-12 18:29:11,209 ERROR 7752 nodejs.ReplyError: ERR invalid password
[egg-scripts] at JavascriptReplyParser.returnError (D:\project\imqianduan.com\node_modules\ioredis\lib\redis\parser.js:25:25)
[egg-scripts] at JavascriptReplyParser.run (D:\project\imqianduan.com\node_modules\redis-parser\lib\javascript.js:135:18)
[egg-scripts] at JavascriptReplyParser.execute (D:\project\imqianduan.com\node_modules\redis-parser\lib\javascript.js:112:10)
[egg-scripts] at Socket.<anonymous> (D:\project\imqianduan.com\node_modules\ioredis\lib\redis\event_handler.js:107:22)
[egg-scripts] at emitOne (events.js:116:13)
[egg-scripts] at Socket.emit (events.js:211:7)
[egg-scripts] at addChunk (_stream_readable.js:263:12)
[egg-scripts] at readableAddChunk (_stream_readable.js:250:11)
[egg-scripts] at Socket.Readable.push (_stream_readable.js:208:10)
[egg-scripts] at TCP.onread (net.js:607:20)
[egg-scripts] name: "ReplyError"
[egg-scripts] message: "ERR invalid password"
[egg-scripts] command: {"name":"auth","args":["abcd987654321"]}
[egg-scripts] pid: 7752
[egg-scripts] hostname: XNZX-PC-103
[egg-scripts]
[egg-scripts] Db.prototype.authenticate method will no longer be available in the next major release 3.x as MongoDB 3.6 will only allow auth against users in the admin db and will no longer allow multiple credentials on a socket. Please authenticate using MongoClient.connect with auth credentials.
[egg-scripts] 2018-10-12 18:29:11,225 ERROR 7752 [-/127.0.0.1/-/1ms GET /] nodejs.ReplyError: ERR invalid password
[egg-scripts] at JavascriptReplyParser.returnError (D:\project\imqianduan.com\node_modules\ioredis\lib\redis\parser.js:25:25)
[egg-scripts] at JavascriptReplyParser.run (D:\project\imqianduan.com\node_modules\redis-parser\lib\javascript.js:135:18)
[egg-scripts] at JavascriptReplyParser.execute (D:\project\imqianduan.com\node_modules\redis-parser\lib\javascript.js:112:10)
[egg-scripts] at Socket.<anonymous> (D:\project\imqianduan.com\node_modules\ioredis\lib\redis\event_handler.js:107:22)
[egg-scripts] at emitOne (events.js:116:13)
[egg-scripts] at Socket.emit (events.js:211:7)
[egg-scripts] at addChunk (_stream_readable.js:263:12)
[egg-scripts] at readableAddChunk (_stream_readable.js:250:11)
[egg-scripts] at Socket.Readable.push (_stream_readable.js:208:10)
[egg-scripts] at TCP.onread (net.js:607:20)
[egg-scripts] name: "ReplyError"
[egg-scripts] message: "ERR invalid password"
[egg-scripts] command: {"name":"auth","args":["abcd987654321"]}
[egg-scripts] pid: 7752
[egg-scripts] hostname: XNZX-PC-103
[egg-scripts]
[egg-scripts] 2018-10-12 18:29:11,226 ERROR 7752 nodejs.ReplyError: ERR invalid password
[egg-scripts] at JavascriptReplyParser.returnError (D:\project\imqianduan.com\node_modules\ioredis\lib\redis\parser.js:25:25)
[egg-scripts] at JavascriptReplyParser.run (D:\project\imqianduan.com\node_modules\redis-parser\lib\javascript.js:135:18)
[egg-scripts] at JavascriptReplyParser.execute (D:\project\imqianduan.com\node_modules\redis-parser\lib\javascript.js:112:10)
[egg-scripts] at Socket.<anonymous> (D:\project\imqianduan.com\node_modules\ioredis\lib\redis\event_handler.js:107:22)
[egg-scripts] at emitOne (events.js:116:13)
[egg-scripts] at Socket.emit (events.js:211:7)
[egg-scripts] at addChunk (_stream_readable.js:263:12)
[egg-scripts] at readableAddChunk (_stream_readable.js:250:11)
[egg-scripts] at Socket.Readable.push (_stream_readable.js:208:10)
[egg-scripts] at TCP.onread (net.js:607:20)
[egg-scripts] name: "ReplyError"
[egg-scripts] message: "ERR invalid password"
[egg-scripts] command: {"name":"auth","args":["abcd987654321"]}
[egg-scripts] pid: 7752
[egg-scripts] hostname: XNZX-PC-103
[egg-scripts]
[egg-scripts] 2018-10-12 18:29:11,226 ERROR 7752 [app_worker] start error, exiting with code:1
[egg-scripts] 2018-10-12 18:29:11,226 ERROR 7752 [app_worker] exit with code:1
[egg-scripts] 2018-10-12 18:29:11,281 ERROR 11844 nodejs.AppWorkerDiedError: [master] app_worker#4:7752 died (code: 1, signal: null, suicide: false, state: dead), current workers: ["1","2","3"]
[egg-scripts] at Master.onAppExit (D:\project\imqianduan.com\node_modules\egg-cluster\lib\master.js:400:21)
[egg-scripts] at emitOne (events.js:116:13)
[egg-scripts] at Master.emit (events.js:211:7)
[egg-scripts] at Messenger.sendToMaster (D:\project\imqianduan.com\node_modules\egg-cluster\lib\utils\messenger.js:133:17)
[egg-scripts] at Messenger.send (D:\project\imqianduan.com\node_modules\egg-cluster\lib\utils\messenger.js:98:12)
[egg-scripts] at EventEmitter.cluster.on (D:\project\imqianduan.com\node_modules\egg-cluster\lib\master.js:268:22)
[egg-scripts] at emitThree (events.js:141:20)
[egg-scripts] at EventEmitter.emit (events.js:217:7)
[egg-scripts] at ChildProcess.worker.process.once (internal/cluster/master.js:186:13)
[egg-scripts] at Object.onceWrapper (events.js:317:30)
[egg-scripts] name: "AppWorkerDiedError"
[egg-scripts] pid: 11844
[egg-scripts] hostname: XNZX-PC-103
[egg-scripts]
[egg-scripts] 2018-10-12 18:29:11,282 ERROR 11844 [master] app_worker#4:7752 start fail, exiting with code:1
[egg-scripts] 2018-10-12 18:29:11,282 ERROR 11844 [master] exit with code:1
[egg-scripts]
[egg-scripts] Start got error, see C:\Users\88888\logs\master-stderr.log
[egg-scripts] Or use `--ignore-stderr` to ignore stderr at startup.
原因: eggjs启动npm run start
时,使用的配置文件是config.default.js
,而我本地的redis和线上的redis密码是不一样,config.default.js配置的是线上的redis密码。
换回本地redis密码,问题迎面解决
总结:
这个问题解决的关键是使用了git
执行命令,提示了更详情的报错信息,详情的报错信息使用问题变得很清晰
所以window开发,还是建议少用cmd吧,使用git或其他专业的命令行工具,事半功倍
公司新入手的Macbook m1最新款,使用NPM RUN DEV,你都可以去喝杯咖啡再回来,再看还在 build,怎么解决?
internal/validators.js:124 throw new ERR_INVALID_ARG_TYPE(name, ‘string‘, value)
for循环里使用await
gulp4构建报错: Error: EPERM: operation not permitted, mkdir
如何在VUE项目中添加stylelint,检查css,scss,less的语法问题,保证团队代码的规范统一
linux下如何安装nodejs
egg-validate默认是英文提示,如何改成中文?
传统的会话认证使用的是session+cookie,前后端分离的项目,更多使用的是token。本文主要实现的token,基于eggjs+redis+jwt+cookie
RSA加密的玩法
在package.json里设置了NODE_ENV在代码中判断不了
The 'typeof' Babel helper is used more than once in your code. It's strongly recommended that you use the "external-helpers" plugin or the "es2015-rollup" preset. See https://github.com/rollup/rollup-plugin-babel#configuring-babel for more information
Unknown plugin &quot;external-helpers&quot; specified in
项目从svn迁到git了,遇到的一个坑:前端工程化打包,会给每个js\css\img文件名添加一个hash值,svn下这个一点问题没有,迁到git后,hash值在不同的电脑上总是不一样。那是什么原因呢?也许你还会发现,有些本来没有修改过的文件,在"git status"时也提示有修改,需要提交。
nodejs应用如果在服务端使用npm包转换jpg,png,gif为webp格式,大大缩小图片的大小
nodejs从8.15.0版本升级到10.15.0版本,gulp打包报错~gulp[2092]: src\node_contextify.cc:633: Assertion `args[1]->IsString()' failed.
npm ERR! Cannot read property &amp;#39;match&amp;#39; of undefined
ReferenceError: internalBinding is not defined
默认情况下,webpack-dev-server只可使用localhost或127.0.0.1访问,用局域网IP访问不了
mvvm项目总会有一些静态文件,如静态合同、协议等等,如何通过webpack来原样复制?
利用http-server搭建静态服务器,即浏览html文件用的~
webpack最小化打包lodash插件,如果全量打包的话,lodash会非常大
vue2.0 项目,利用webpack搭建mock api服务,用于本地调试数据
webpack打包,报"WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB)",记录一下
webpack 是一个现代 JavaScript 应用程序的静态模块打包器(static module bundler)。在 webpack 处理应用程序时,它会在内部创建一个依赖图(dependency graph),用于映射到项目需要的每个模块,然后将所有这些依赖生成到一个或多个bundle
网站是基于eggjs写的,某天突然报spawn tail ENOENT错误,难道'child_process'调用spawn问题?
用npm-check批量更新依赖,检测package.json文件,检测到可更新的文件,然后批量更新
nodejs 社区乃至 Web 前端工程化领域发展到今天,作为 node 自带的包管理工具的 npm 已经成为每个前端开发者必备的工具。但是现实状况是,我们很多人对这个nodejs基础设施的使用和了解还停留在: 会用 npm install 这里(一言不合就删除整个 node_modules 目录然后重新 install 这种事你没做过吗?)
如何发布一个npm模块到npmjs.com
nrm是一个npm源管理工具,利用它我们可以快速切换npm源,利用nrm还可以测试哪个源最快。如果哪个npm依赖安装失败,不防切换一下npm源试试
npm 教程
阮一峰老师的package.json文件详解