नहीं पढ़ सकता है, मैं अपने नोड पैकेज निर्भरताओं को प्रबंधित करने की कोशिश कर रहा हूं। मैं एक कमांड चलाकर सभी आवश्यक निर्भरताओं को स्थापित करने में सक्षम होना चाहता हूं, और जो मैंने पढ़ा है, उससे प्राप्त करने का एक तरीका package.json
फ़ाइल का उपयोग कर रहा है और npm install
चला रहा है। तो मेरी JSON फ़ाइल इस तरह दिखता है:एनपीएम इंस्टॉल पैकेज.जेसन
{
"name": "Name-Of-The-Thing",
"description": "The Thing's Name",
"author": "The Dude <[email protected]>",
"dependencies": {
"mocha":">= 1.12.0",
"mocha-phantomjs":">= 3.1.0",
"chai":">= 1.7.2",
"phantomjs":">= 1.9.1"
}
}
हालांकि npm install
रिपोर्ट निम्न त्रुटि:
npm ERR! Failed to parse json
npm ERR! Unexpected token ?
npm ERR! File: C:\Path\To\The\Thing\package.json
npm ERR! Failed to parse package.json data.
npm ERR! package.json must be actual JSON, not just JavaScript.
npm ERR!
npm ERR! This is not a bug in npm.
npm ERR! Tell the package author to fix their package.json file. JSON.parse
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "test"
npm ERR! cwd C:\Path\To\The\Thing
npm ERR! node -v v0.8.15
npm ERR! npm -v 1.1.66
npm ERR! file C:\Path\To\The\Thing\package.json
npm ERR! code EJSONPARSE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Path\To\The\Thing\npm-debug.log
npm ERR! not ok code 0
किसी को भी पता है क्यों?
यह विशेष पैकेज.जेसन मेरे लिए ठीक काम कर रहा है। –
@MerynStol यह कमाल है। यह जानकर खुशी हुई कि यह वास्तव में सरल है। शायद यह एक मंच मुद्दा है। मैं विंडोज 8 पर उस कमांड को चला रहा हूं, और 64 बिट आर्किटेक्चर – Ceilingfish
"अप्रत्याशित टोकन" को देखते हुए? त्रुटि, शायद जेसन फ़ाइल में कुछ अजीब (अदृश्य) चरित्र है। हो सकता है कि अलग-अलग पाठ संपादक, या अपने संपादक की सेटिंग्स के साथ बेवकूफ कोशिश करें। फिर package.json फ़ाइल को पुन: सहेजें। मैं हर जगह यूटीएफ -8 का उपयोग करता हूं। –