27

मैं यमन वेबपेज पर codelab के साथ पीछा कर रहा हूं, और अब तक मैं साथ चलने में कामयाब रहा हूं (मेरे विकास पर्यावरण को प्राप्त करने वाले कुछ प्रमुख हिचकी के साथ, लेकिन अब यह कोई त्रुटि नहीं लौटाता है)।योन और बॉवर बूटस्ट्रैप सीएसएस (एंगुलरजेएस जनरेटर) नहीं जोड़ रहा है

इसलिए मैंने अपना प्रोजेक्ट फ़ोल्डर बनाया और yo चलाया, AngularJS का चयन किया और चीज़ चलाएं। काफी प्रक्रिया में जल्द ही मैं एक शीघ्र ? Overwrite package.json? मैं y साथ जवाब मिला है और निम्न चेतावनी मिल गया:

npm WARN package.json [email protected] No license field. 
npm WARN peerDependencies The peer dependency [email protected]>=0.9 included from karma-jasmine will no 
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency 
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly. 
npm WARN peerDependencies The peer dependency [email protected]* included from karma-jasmine will no 
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency 
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly. 
npm WARN peerDependencies The peer dependency [email protected]>=0.9 included from karma-phantomjs-launcher will no 
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency 
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly. 
npm WARN peerDependencies The peer dependency [email protected]>=1.9 included from karma-phantomjs-launcher will no 
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency 
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly. 
npm WARN peerDependencies The peer dependency [email protected]~0.12.0 included from grunt-karma will no 
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency 
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly. 
npm WARN optional dep failed, continuing [email protected] 

उसके बाद, यह समाप्त हो गया यह क्या कर रहा था, इसलिए मैं की वजह से फिर से bower install भाग गया बस सुनिश्चित करने के (package.json बात), और फिर grunt serve। अब grunt कहते हैं, त्रुटियों के बिना, लेकिन मेरा पृष्ठ केवल main.css लोड करता है। मुझे लगता है कि bootstrap.css फ़ाइल गुम है। This ऐसा लगता है, जब कोडेलब निर्देश कहते हैं कि यह this जैसा दिखना चाहिए।

यदि आपको जेनरेट किए गए बारे में और जानकारी चाहिए, तो यहां GitHub repository link है।

जो भी मैं गलत कर रहा हूं उस पर कोई अंतर्दृष्टि (यदि कुछ भी हो) का स्वागत है।

उत्तर

57

कोडेलैब करने के बाद मुझे वही परिणाम मिला जो आपको मिल रहा है (चेतावनियां और सभी)। मुझे बस बूटस्ट्रैप 3.3.4 पर वापस रोल करके इस मुद्दे के आसपास काम करना पड़ा। फिर निम्नलिखित चलाने

"bootstrap": "3.3.4", 

और यह काम करना चाहिए:

bower.json बस संपादित करें और करने के लिए बूटस्ट्रैप लाइन बदलने

bower install 
    grunt serve 
+2

इसे संपादित करने से पहले, मेरी बूटस्ट्रैप लाइन में संस्करण संख्या से पहले '^' था (जैसे "कोणीय": "^ 1.3.0" ')। जो भी करता है उस पर कोई विचार, और यदि मुझे बूटस्ट्रैप संस्करण से पहले इसे वापस रखना चाहिए? इसके अलावा, साइट अब दिखती है, इसलिए मैं कोडेलैब के साथ आगे बढ़ने के लिए तैयार हूं। धन्यवाद –

+4

मेरा मानना ​​है कि इसका मतलब है कि आवश्यकता 1.3.0 से अधिक है। तो बूटस्ट्रैप के लिए यह "बूटस्ट्रैप" था: "^ 3.2.0", जिसका मतलब 3.2.0 से अधिक है जो कुछ भी स्थापित करें। इसलिए यह नवीनतम 3.3.5 चलाता है और स्थापित करता है जो काम नहीं करता है।^के बिना इसे 3.3.4 पर सेट करना कहता है कि केवल इस संस्करण को स्थापित करें, कुछ भी ज्यादा नहीं। – chipzilla

+0

@chipzilla आपको धन्यवाद, आपने अपना पहला ऐप बचाया :) –

11

आप एक खोल से चिपके हैं, तो आप सिर्फ टाइप कर सकते हैं :

bower install --save bootstrap#3.3.4 
grunt serve 

इससे यह सुनिश्चित होगा कि ट्विटर बूटस्ट्रैप अधिक बोवर/यो-कोणीय अनुकूल वी में डाउनग्रेड हो जाए ersion और इसे एक देव निर्भरता के रूप में सहेजें। इसके बाद ग्रंट अपने 'सेवा' कार्य के दौरान 'वायर्डेप' चलाएगा और आपके प्रोजेक्ट के index.html में bootstrap.css को जोड़ देगा।

26

यह मेरे लिए भी काम नहीं करता था। मुझे यहां से एक समाधान मिला: https://github.com/twbs/bootstrap/issues/16663

हमने इस परियोजना को bower.json को ओवरराइड करके अस्थायी रूप से तय किया। हमारे लिए यह ठीक काम करता है, लेकिन हम बूटस्ट्रैप से कुछ समाधान की प्रतीक्षा कर रहे हैं।

"overrides":{ 
    "bootstrap" : { 
     "main": [ 
      "less/bootstrap.less", 
      "dist/css/bootstrap.css", 
      "dist/js/bootstrap.js" 
      ] 
    } 
    } 
1

bower.json फ़ाइल में, बूटस्ट्रैप की निर्भरता संस्करण के रूप में सेट किया गया है:

"bootstrap": "^3.2.0", 

डिफ़ॉल्ट रूप से, कि नवीनतम संस्करण 3.2.0 की तुलना में अधिक स्थापित मतलब है। नतीजतन, नवीनतम संस्करण 3.3.5 स्थापित है और वह टूटता है।

तो, ^ संकेत को हटाने और बदलें:

"bootstrap": "^3.2.0", 

साथ:

"bootstrap": "3.3.4", 
0

यह आदर्श नहीं है, लेकिन मैं वापस लुढ़का संस्करण 3.3.4 और इस तरह की स्थापना बूटस्ट्रैप के लिए:

bower install --save bootstrap#3.3.4 

bower_concat: { 
    all: { 
    dest: { 
     'js': 'path/to/file/_bower.js', 
     'css': 'path/to/file/_bower.css' 
    } 
    } 
} 
संबंधित मुद्दे