create-react-app不起作用?

时间:2018-06-01 18:36:21

标签: node.js reactjs npm

我是一名经常反应的用户,通常使用create-react-app但是从今天早上起它无效。 我已经检查过npm,它安装完好了。我已经检查过create-react-app是全局安装在我的系统上的。错误来自一些JSON文件。

我的系统上安装的版本: 节点-v V9.0.0

$ npm -v 5.5.1

我已经附上了下面的日志文件,我正在附加错误出现的日志文件:

 917 http fetch GET 200 https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex 19ms (from cache)
918 silly fetchPackageMetaData error for babel-plugin-transform-es2015-unicode-regex@^6.22.0 Unexpected end of JSON input while parsing near '....7":{"name":"babel-pl'
919 silly pacote range manifest for babel-plugin-transform-es2015-sticky-regex@^6.22.0 fetched in 25ms
920 silly resolveWithNewModule babel-plugin-transform-es2015-sticky-regex@6.24.1 checking installable status
921 silly pacote range manifest for babel-plugin-transform-es2015-template-literals@^6.22.0 fetched in 24ms
922 silly resolveWithNewModule babel-plugin-transform-es2015-template-literals@6.22.0 checking installable status
923 silly pacote range manifest for babel-plugin-transform-exponentiation-operator@^6.22.0 fetched in 23ms
924 silly resolveWithNewModule babel-plugin-transform-exponentiation-operator@6.24.1 checking installable status
925 silly pacote range manifest for babel-plugin-transform-es2015-typeof-symbol@^6.23.0 fetched in 24ms
926 silly resolveWithNewModule babel-plugin-transform-es2015-typeof-symbol@6.23.0 checking installable status
927 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '....7":{"name":"babel-pl'
927 verbose stack     at JSON.parse (<anonymous>)
927 verbose stack     at parseJson (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\node_modules\json-parse-better-errors\index.js:7:17)
927 verbose stack     at consumeBody.call.then.buffer (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\src\body.js:96:50)
927 verbose stack     at <anonymous>
927 verbose stack     at process._tickCallback (internal/process/next_tick.js:188:7)
928 verbose cwd C:\Users\ashve\Desktop\Startup\startup
929 verbose Windows_NT 10.0.17134
930 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save" "--save-exact" "--loglevel" "error" "react" "react-dom" "react-scripts"
931 verbose node v9.0.0
932 verbose npm  v5.5.1
933 error Unexpected end of JSON input while parsing near '....7":{"name":"babel-pl'
934 verbose exit [ 1, true ]

enter image description here

1 个答案:

答案 0 :(得分:1)

我看到你正在使用Windows。尝试清理缓存。

 npm cache clean --force 

转到%appdata%\npm-cache并检查目录是否干净。如果没有,请手动删除目录中的所有文件。

现在尝试create-react-app yourAppName