simple-react icon indicating copy to clipboard operation
simple-react copied to clipboard

跑不起来

Open yodoe opened this issue 4 years ago • 4 comments

提示如下错误:

parcel 版本:1.12.5

var node2 = new Node(); for (var key in this) { // Do not clone comments tha...... } could not be cloned. var node2 = new Node(); for (var key in this) { // Do not clone comments tha...... } could not be cloned. at Object.serialize (v8.js:268:7) at _default (/usr/local/lib/node_modules/parcel-bundler/node_modules/@babel/core/lib/transformation/util/clone-deep.js:22:34)

yodoe avatar Jun 06 '21 08:06 yodoe

我也是,跑不起来

shuihu001 avatar Jul 09 '21 07:07 shuihu001

我碰到过这个问题,原因是 devDependencies 里声明的依赖是 ^6.26.0 等带有 ^ 号的,但是直接运行npm i的话,现在(2021.08)安装的会是7.几的版本了,也不确定就一定是这个问题,但是,当我把 devDependencies 里的所有 ^ 去掉再 npm i ,就可以跑起来了。

LeehanLee avatar Aug 09 '21 02:08 LeehanLee

确实,去掉^ 号再npm i就跑起来了,感谢楼上

chisulily avatar Aug 10 '21 07:08 chisulily

babel配置更新成这样试试

{
    "presets": [
    	"@babel/preset-env",
    	"@babel/preset-react"
	],
    "plugins": [
        ["transform-react-jsx", {
            "pragma": "React.createElement"
        }]
    ]
}

giftedunicorn avatar Dec 02 '21 07:12 giftedunicorn