2016-12-04 2 views
0

Моей рабочей среды:получают ошибки при запуске "ионной служить"

Macos

узла v6.9.1

НОГО v3.10.8

ионную v2.1.14

I получили эти ошибки при запуске ionic serve:

> [email protected] ionic:serve /Users/Hao/Project/OneCharacter 
> ionic-app-scripts serve 

module.js:597 
    return process.dlopen(module, path._makeLong(filename)); 
       ^

Error: dlopen(/Users/Hao/Project/OneCharacter/node_modules/@ionic/app-scripts/node_modules/node-sass/vendor/darwin-x64-48/binding.node, 1): no suitable image found. Did find: 
    /Users/Hao/Project/OneCharacter/node_modules/@ionic/app-scripts/node_modules/node-sass/vendor/darwin-x64-48/binding.node: truncated mach-o error: segment __TEXT extends to 1212416 which is past end of file 121392 
    at Error (native) 
    at Object.Module._extensions..node (module.js:597:18) 
    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.<anonymous> (/Users/Hao/Project/OneCharacter/node_modules/@ionic/app-scripts/node_modules/node-sass/lib/index.js:23:15) 
    at Module._compile (module.js:570:32) 
    at Object.Module._extensions..js (module.js:579:10) 

npm ERR! Darwin 16.1.0 
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "ionic:serve" "--" 
npm ERR! node v6.9.1 
npm ERR! npm v3.10.8 
npm ERR! code ELIFECYCLE 
npm ERR! [email protected] ionic:serve: `ionic-app-scripts serve` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] ionic:serve script 'ionic-app-scripts serve'. 
npm ERR! Make sure you have the latest version of node.js and npm installed. 
npm ERR! If you do, this is most likely a problem with the ionic-app-base package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR!  ionic-app-scripts serve 
npm ERR! You can get information on how to open an issue for this project with: 
npm ERR!  npm bugs ionic-app-base 
npm ERR! Or if that isn't available, you can get their info via: 
npm ERR!  npm owner ls ionic-app-base 
npm ERR! There is likely additional logging output above. 

npm ERR! Please include the following file with any support request: 
npm ERR!  /Users/Hao/Project/OneCharacter/npm-debug.log 
There was an error serving your Ionic application: There was an error with the spawned command: serve 

Я уже запустил npm install в своем проекте. Кажется, это проблема о node-sass? Или, может быть, это из-за плохой сети?

ответ

0

Если у вас плохое сетевое подключение, то это, вероятно, проблема. Я столкнулся с подобной проблемой. «Ионная услуга» требует, чтобы интернет-соединение выполнялось должным образом.

Тем не менее, если это не так, попробуйте запустить следующую команду, чтобы служить приложение в режиме разработки:

npm run ionic:serve 

Я также предлагаю вам обновить ионную CLI к более стабильной версии со следующим команда:

# May need "sudo" 
npm install -g [email protected] 
+0

Охх ... Я забыл закрыть этот вопрос. Но все равно большое вам спасибо! Я думаю, что моя проблема очень вероятна из-за плохой сети (поскольку я в Китае). Вот возможное решение для китайских программистов: https://github.com/lmk123/blog/issues/28 – awmleer

Смежные вопросы