我正在按照这里的步骤https://babeljs.io/setup#installation。
我创建一个 package.json 文件然后运行
npm install --save-dev babel-cli
我得到错误:
npm ERR! Darwin 17.7.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--
save-dev" "babel-cli"
npm ERR! node v6.11.2
npm ERR! npm v3.10.10
npm ERR! file /Users/name/Desktop/Graphs/package.json
npm ERR! code EJSONPARSE
npm ERR! Failed to parse json
npm ERR! No data, empty input at 1:1
npm ERR!
npm ERR! ^
npm ERR! File: /Users/name/Desktop/Graphs/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! Please include the following file with any support request:
npm ERR! /Users/name/Desktop/Graphs/npm-debug.log
我试过了
npm cache clear
和
npm update
但它仍然不起作用。有任何想法吗?