简体   繁体   English

最新的 npm cra 安装错误

[英]Latest npm cra install bug

Just updated to npm 6.14.4 and when I try to create a new app with cra-template this error shows up.刚刚更新到 npm 6.14.4,当我尝试使用 cra-template 创建新应用程序时,出现此错误。 How do I fix this?我该如何解决?

npx create-react-app sphinx.ui.react

Error Log错误日志

50 timing stage:runTopLevelLifecycles Completed in 5234ms
51 verbose stack SyntaxError: Unexpected token : in JSON at position 18277 while parsing near '...true,"daizch":true}}:true,"akabeko":true...'
51 verbose stack     at JSON.parse (<anonymous>)
51 verbose stack     at parseJson (C:\Users\Altanbagana\AppData\Roaming\npm\node_modules\npm\node_modules\json-parse-better-errors\index.js:7:17)
51 verbose stack     at C:\Users\Altanbagana\AppData\Roaming\npm\node_modules\npm\node_modules\node-fetch-npm\src\body.js:96:50
51 verbose stack     at processTicksAndRejections (internal/process/task_queues.js:97:5)
52 verbose cwd C:\Users\Altanbagana\Documents\Programming\Web Projects
53 verbose Windows_NT 10.0.18363
54 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Altanbagana\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "create-react-app@latest" "--global" "--prefix" "C:\\Users\\Altanbagana\\AppData\\Roaming\\npm-cache\\_npx\\5552" "--loglevel" "error" "--json"
55 verbose node v12.16.1
56 verbose npm  v6.14.4
57 error Unexpected token : in JSON at position 18277 while parsing near '...true,"daizch":true}}:true,"akabeko":true...'
58 verbose exit [ 1, true ]

尝试卸载该版本,然后重新安装所需的版本,我在使用 discord.js 时遇到了这个问题 - 在我执行此操作后它起作用了

I accidentally changed my registry.我不小心更改了我的注册表。 It was my fault xD.是我的错xD。 Changing back to default fixed it改回默认修复它

npm config set registry https://registry.npmjs.com/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM