gpt4 book ai didi

javascript - yarn 无法使用 node 12.1.0 构建 node-sass

转载 作者:数据小太阳 更新时间:2023-10-29 06:04:05 25 4
gpt4 key购买 nike

我正在尝试使用 yarn install 安装我的包

我安装了 node 12.1.0,据我所知,node-sass 需要至少版本 4.12+ 才能工作 Node 12

我的 package.json 文件是这样的:

{
"name": "redacted",
"private": true,
"dependencies": {
"@rails/webpacker": "3.5",
"babel-preset-react": "^6.24.1",
"bootstrap": "^4.1.2",
"font-awesome": "^4.7.0",
"js-md5": "^0.7.3",
"moment": "^2.22.2",
"prop-types": "^15.6.2",
"qrcode.react": "^0.8.0",
"react": "^16.4.1",
"react-big-calendar": "^0.19.2",
"react-dom": "^16.4.1",
"react-loading": "^2.0.3",
"react-router": "^4.3.1",
"react-router-dom": "^4.3.1",
"react-transition-group": "^2.5.0",
"urijs": "^1.19.1"
},
"devDependencies": {
"webpack-dev-server": "2.11.2"
}
}

我得到的( chop 的)错误是:

../fsevents.cc:85:58: error: expected ';' after top level declarator
void FSEvents::Initialize(v8::Handle<v8::Object> exports) {
^
;
30 warnings and 14 errors generated.
make: *** [Release/obj.target/fse/fsevents.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/snowflakekiller/Documents/Projects/Code/sjc_platform/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:196:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:256:12)
gyp ERR! System Darwin 18.2.0
gyp ERR! command \"/usr/local/Cellar/node/12.1.0/bin/node\" \"/Users/snowflakekiller/Documents/Projects/Code/sjc_platform/node_modules/node-gyp/bin/node-gyp.js\" \"build\" \"--fallback-to-build\" \"--module=/Users/snowflakekiller/Documents/Projects/Code/sjc_platform/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64/fse.node\" \"--module_name=fse\" \"--module_path=/Users/snowflakekiller/Documents/Projects/Code/sjc_platform/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64\" \"--napi_version=4\" \"--node_abi_napi=napi\"
gyp ERR! cwd /Users/snowflakekiller/Documents/Projects/Code/sjc_platform/node_modules/fsevents
gyp ERR! node -v v12.1.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/Cellar/node/12.1.0/bin/node /Users/snowflakekiller/Documents/Projects/Code/sjc_platform/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/snowflakekiller/Documents/Projects/Code/sjc_platform/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64/fse.node --module_name=fse --module_path=/Users/snowflakekiller/Documents/Projects/Code/sjc_platform/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64 --napi_version=4 --node_abi_napi=napi' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/Users/snowflakekiller/Documents/Projects/Code/sjc_platform/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:196:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1000:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:267:5)
node-pre-gyp ERR! System Darwin 18.2.0
node-pre-gyp ERR! command \"/usr/local/Cellar/node/12.1.0/bin/node\" \"/Users/snowflakekiller/Documents/Projects/Code/sjc_platform/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp\" \"install\" \"--fallback-to-build\"
node-pre-gyp ERR! cwd /Users/snowflakekiller/Documents/Projects/Code/sjc_platform/node_modules/fsevents
node-pre-gyp ERR! node -v v12.1.0
node-pre-gyp ERR! node-pre-gyp -v v0.10.0
node-pre-gyp ERR! not ok

我已经尝试单独安装 node-sassyarn add node-sass 但它仍然失败并出现同样的错误。

我怎样才能克服这个问题?

最佳答案

我通过删除锁定文件并再次运行 yarn install 设法解决了这个问题。

关于javascript - yarn 无法使用 node 12.1.0 构建 node-sass,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56150099/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com