如何解决运行yarn install返回语法错误
我是Yarn的新手。每当我运行yarn install
来安装依赖项时,在yarn-error.log
文件中都会出现以下错误:
Arguments:
/usr/local/Cellar/node/14.7.0/bin/node /usr/local/Cellar/yarn/1.22.4/libexec/bin/yarn.js install
PATH:
/Users/firstlastname/anaconda3/bin:/Users/firstlastname/anaconda3/condabin:/usr/local/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/Users/firstlastname/google-cloud-sdk/bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
Yarn version:
1.22.4
Node version:
14.7.0
Platform:
darwin x64
Trace:
SyntaxError: /Users/firstlastname/Documents/01_projects/src/react-js/package.json: Unexpected token / in JSON at position 108
at JSON.parse (<anonymous>)
at /usr/local/Cellar/yarn/1.22.4/libexec/lib/cli.js:1625:59
at Generator.next (<anonymous>)
at step (/usr/local/Cellar/yarn/1.22.4/libexec/lib/cli.js:310:30)
at /usr/local/Cellar/yarn/1.22.4/libexec/lib/cli.js:321:13
我尝试通过从nodejs.org网站上清除已使用安装程序包安装的Node版本并使用brew uninstall node
和Node卸载Yarn并使用brew install yarn
重新安装yarn + node,但没有成功。 / p>
有什么想法可以解决问题吗?
编辑,这是package.json
:
{
"name": "react-js","version": "0.1.0","homepage": "https://myname.github.io/storytelling","private": true,"dependencies": {
"d3-scale": "^3.2.1","mapbox-gl": "1.5.0","react": "^16.9.0","react-dom": "^16.9.0","react-scripts": "3.1.1","scrollama": "2.0.1"
},"scripts": {
"start": "react-scripts start","build": "react-scripts build","test": "react-scripts test","eject": "react-scripts eject","predeploy": "yarn build","deploy": "gh-pages -d build"
},"eslintConfig": {
"extends": "react-app"
},"browserslist": {
"production": [
">0.2%","not dead","not op_mini all"
],"development": [
"last 1 chrome version","last 1 firefox version","last 1 safari version"
]
},"devDependencies": {
"gh-pages": "^3.1.0"
}
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。