node_modules \ create-react-context \ lib \ index.js中的意外字符''(1:0) [英] Unexpected character ' ' (1:0) in node_modules\create-react-context\lib\index.js

查看:60
本文介绍了node_modules \ create-react-context \ lib \ index.js中的意外字符''(1:0)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每次我使用yarn添加软件包时,都会在create-react-app中发生这种情况.

 <代码> ./node_modules/create-react-context/lib/index.js语法错误:d:\ project \ client \ node_modules \ create-react-context \ lib \ index.js:意外字符''(1:0]>1 ||^ 

我必须复制此内容 https://github.com/jamiebuilds/create-react-context/blob/master/src/index.js 并每次将其粘贴到node_modules \ create-react-context \ lib \ index.js中,以消除该错误.

我正在使用VSCodium作为编辑器.如何永久消除此错误?

解决方案

我没有找到永久解决此问题的方法.由于某种原因,我不得不停止该项目的工作,从那时起,我在任何其他项目中都没有遇到这个问题.将来,如果有人偶然发现此错误,这是为您提供的临时解决方案.

复制此文件的内容 https://github.com/jamiebuilds/create-react-context/blob/master/src/index.js node_modules \ create-react-context \ lib \ index.js.

This keeps happening in create-react-app every time I add a package using yarn.

./node_modules/create-react-context/lib/index.js
SyntaxError: d:\project\client\node_modules\create-react-context\lib\index.js: Unexpected character ' ' (1:0)

> 1 |
    | ^

I have to copy this https://github.com/jamiebuilds/create-react-context/blob/master/src/index.js and paste it to node_modules\create-react-context\lib\index.js every time to get rid off that error.

I'm using VSCodium as my editor. How can I get rid off this error permanently?

解决方案

I haven't found a permanent solution to this problem. I had to stop working on that project for some reason and since then I didn't face this problem in any other project. In future if anyone stumbles upon this error this is the temporary solution for you.

Copy the contents of this file https://github.com/jamiebuilds/create-react-context/blob/master/src/index.js to node_modules\create-react-context\lib\index.js.

这篇关于node_modules \ create-react-context \ lib \ index.js中的意外字符''(1:0)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆