herozhou / vue-framework-wz

👏vue后台管理框架👏
http://herozhou.coding.me/vue-framework-wz/#/dashboard
MIT License
4.32k stars 1.35k forks source link

(node:23633) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Exited with code 3 #8

Closed deravo closed 6 years ago

deravo commented 6 years ago

root@ubuntu:/opt/vue-framework-wz# npm run dev

WZ@1.0.0 dev /opt/vue-framework-wz node build/dev-server.js

(node:23633) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Exited with code 3

ERROR Failed to compile with 2 errors 3:45:04 AM

error in ./src/views/login/index.vue

Module build failed: Error: ENOENT: no such file or directory, scandir '/opt/vue-framework-wz/node_modules/node-sass/vendor' at Error (native) at Object.fs.readdirSync (fs.js:953:18) at Object.getInstalledBinaries (/opt/vue-framework-wz/node_modules/node-sass/lib/extensions.js:124:13) at foundBinariesList (/opt/vue-framework-wz/node_modules/node-sass/lib/errors.js:20:15) at foundBinaries (/opt/vue-framework-wz/node_modules/node-sass/lib/errors.js:15:5) at Object.module.exports.missingBinary (/opt/vue-framework-wz/node_modules/node-sass/lib/errors.js:45:5) at module.exports (/opt/vue-framework-wz/node_modules/node-sass/lib/binding.js:15:30) at Object. (/opt/vue-framework-wz/node_modules/node-sass/lib/index.js:14:35) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object. (/opt/vue-framework-wz/node_modules/sass-loader/lib/loader.js:3:14)

@ ./~/vue-style-loader!./~/css-loader?{"minimize":false,"sourceMap":false}!./~/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-0f310798","scoped":false,"hasInlineConfig":false}!./~/sass-loader/lib/loader.js?{"sourceMap":false}!./~/vue-loader/lib/selector.js?type=styles&index=1!./src/views/login/index.vue 4:14-406 13:3-17:5 14:22-414 @ ./src/views/login/index.vue @ ./src/views ^.\/.*.vue$ @ ./src/router/_import_development.js @ ./src/router/index.js @ ./src/main.js @ multi ./build/dev-client ./src/main.js

error in ./src/components/SidebarItem.vue

Module build failed: Error: ENOENT: no such file or directory, scandir '/opt/vue-framework-wz/node_modules/node-sass/vendor' at Error (native) at Object.fs.readdirSync (fs.js:953:18) at Object.getInstalledBinaries (/opt/vue-framework-wz/node_modules/node-sass/lib/extensions.js:124:13) at foundBinariesList (/opt/vue-framework-wz/node_modules/node-sass/lib/errors.js:20:15) at foundBinaries (/opt/vue-framework-wz/node_modules/node-sass/lib/errors.js:15:5) at Object.module.exports.missingBinary (/opt/vue-framework-wz/node_modules/node-sass/lib/errors.js:45:5) at module.exports (/opt/vue-framework-wz/node_modules/node-sass/lib/binding.js:15:30) at Object. (/opt/vue-framework-wz/node_modules/node-sass/lib/index.js:14:35) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object. (/opt/vue-framework-wz/node_modules/sass-loader/lib/loader.js:3:14)

@ ./~/vue-style-loader!./~/css-loader?{"minimize":false,"sourceMap":false}!./~/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-c00c548e","scoped":true,"hasInlineConfig":false}!./~/sass-loader/lib/loader.js?{"sourceMap":false}!./~/vue-loader/lib/selector.js?type=styles&index=0!./src/components/SidebarItem.vue 4:14-399 13:3-17:5 14:22-407 @ ./src/components/SidebarItem.vue @ ./~/babel-loader/lib!./~/vue-loader/lib/selector.js?type=script&index=0!./src/components/Sidebar.vue @ ./src/components/Sidebar.vue @ ./~/babel-loader/lib!./~/vue-loader/lib/selector.js?type=script&index=0!./src/containers/Full.vue @ ./src/containers/Full.vue @ ./src/router/index.js @ ./src/main.js @ multi ./build/dev-client ./src/main.js

Listening at http://localhost:9001


os@Ubuntu 16.04.3 LTS arch@x86 nodejs@6.11.3 npm@3.10.10

herozhou commented 6 years ago

Do you run npm install before executing npm run dev?

herozhou commented 6 years ago

If you executed npm install not is npm install --registry=https://registry.npm.taobao.org

Check if node_modules contains the node-sass / vendor folder

If so, it may be a node-sass problem, you can consult the relevant documents

deravo commented 6 years ago

在国外的虚拟主机上搞的,运行不带 registery 的 npm install 下面的是刚才操作的日志,另外检查过了,node_modules 下的 node-sass 下没有 vendor 目录

root@ubuntu:/opt# git clone https://github.com/herozhou/vue-framework-wz.git Cloning into 'vue-framework-wz'... remote: Counting objects: 1316, done. remote: Compressing objects: 100% (257/257), done. remote: Total 1316 (delta 99), reused 272 (delta 63), pack-reused 988 Receiving objects: 100% (1316/1316), 105.41 MiB | 9.46 MiB/s, done. Resolving deltas: 100% (474/474), done.

Checking connectivity... done. root@ubuntu:/opt# root@ubuntu:/opt# cd vue-framework-wz/ root@ubuntu:/opt/vue-framework-wz# ls bin build config favicon.ico index.html LICENSE package.json README.md src static root@ubuntu:/opt/vue-framework-wz# npm install npm WARN prefer global node-gyp@3.6.2 should be installed with -g

node-sass@4.5.3 install /opt/vue-framework-wz/node_modules/node-sass node scripts/install.js

root@ubuntu:/opt/vue-framework-wz# npm run dev

WZ@1.0.0 dev /opt/vue-framework-wz node build/dev-server.js

(node:30755) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Exited with code 3

ERROR Failed to compile with 2 errors 11:28:47 PM

error in ./src/views/login/index.vue

Module build failed: Error: ENOENT: no such file or directory, scandir '/opt/vue-framework-wz/node_modules/node-sass/vendor' at Error (native) at Object.fs.readdirSync (fs.js:953:18) at Object.getInstalledBinaries (/opt/vue-framework-wz/node_modules/node-sass/lib/extensions.js:124:13) at foundBinariesList (/opt/vue-framework-wz/node_modules/node-sass/lib/errors.js:20:15) at foundBinaries (/opt/vue-framework-wz/node_modules/node-sass/lib/errors.js:15:5) at Object.module.exports.missingBinary (/opt/vue-framework-wz/node_modules/node-sass/lib/errors.js:45:5) at module.exports (/opt/vue-framework-wz/node_modules/node-sass/lib/binding.js:15:30) at Object. (/opt/vue-framework-wz/node_modules/node-sass/lib/index.js:14:35) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object. (/opt/vue-framework-wz/node_modules/sass-loader/lib/loader.js:3:14)

@ ./~/vue-style-loader!./~/css-loader?{"minimize":false,"sourceMap":false}!./~/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-0f310798","scoped":false,"hasInlineConfig":false}!./~/sass-loader/lib/loader.js?{"sourceMap":false}!./~/vue-loader/lib/selector.js?type=styles&index=1!./src/views/login/index.vue 4:14-406 13:3-17:5 14:22-414 @ ./src/views/login/index.vue @ ./src/views ^.\/.*.vue$ @ ./src/router/_import_development.js @ ./src/router/index.js @ ./src/main.js @ multi ./build/dev-client ./src/main.js

error in ./src/components/SidebarItem.vue

Module build failed: Error: ENOENT: no such file or directory, scandir '/opt/vue-framework-wz/node_modules/node-sass/vendor' at Error (native) at Object.fs.readdirSync (fs.js:953:18) at Object.getInstalledBinaries (/opt/vue-framework-wz/node_modules/node-sass/lib/extensions.js:124:13) at foundBinariesList (/opt/vue-framework-wz/node_modules/node-sass/lib/errors.js:20:15) at foundBinaries (/opt/vue-framework-wz/node_modules/node-sass/lib/errors.js:15:5) at Object.module.exports.missingBinary (/opt/vue-framework-wz/node_modules/node-sass/lib/errors.js:45:5) at module.exports (/opt/vue-framework-wz/node_modules/node-sass/lib/binding.js:15:30) at Object. (/opt/vue-framework-wz/node_modules/node-sass/lib/index.js:14:35) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object. (/opt/vue-framework-wz/node_modules/sass-loader/lib/loader.js:3:14)

@ ./~/vue-style-loader!./~/css-loader?{"minimize":false,"sourceMap":false}!./~/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-c00c548e","scoped":true,"hasInlineConfig":false}!./~/sass-loader/lib/loader.js?{"sourceMap":false}!./~/vue-loader/lib/selector.js?type=styles&index=0!./src/components/SidebarItem.vue 4:14-399 13:3-17:5 14:22-407 @ ./src/components/SidebarItem.vue @ ./~/babel-loader/lib!./~/vue-loader/lib/selector.js?type=script&index=0!./src/components/Sidebar.vue @ ./src/components/Sidebar.vue @ ./~/babel-loader/lib!./~/vue-loader/lib/selector.js?type=script&index=0!./src/containers/Full.vue @ ./src/containers/Full.vue @ ./src/router/index.js @ ./src/main.js @ multi ./build/dev-client ./src/main.js

Listening at http://localhost:9001

^C

herozhou commented 6 years ago

应该是npm版本太低了,至少要>5.0

deravo commented 6 years ago

不是那个问题,已经找到问题了,1是内存不足,ram 512MB, swap 200MB,2是vps主机商在ipv4下不允许开启http服务,换了个大内存没有限制的 vps 没有问题了,这个问题可以关闭了

ygm521 commented 5 years ago

node build/dev-server.js

(node:6307) UnhandledPromiseRejectionWarning: Error: Exited with code 3 at ChildProcess. (/home/wbq/lor_rest/RillAdmin-master/vue-framework-wz/node_modules/opn/index.js:83:13) at Object.onceWrapper (events.js:273:13) at ChildProcess.emit (events.js:182:13) at maybeClose (internal/child_process.js:961:16) at Socket.stream.socket.on (internal/child_process.js:380:11) at Socket.emit (events.js:182:13) at Pipe._handle.close (net.js:598:12) (node:6307) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:6307) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.