当我运行npm run dev时,出现以下错误: 如果有人了解,请教我
//错误内容
TypeError:“原始”参数的类型必须为Function
./ node_modules / node-libs-browser / node_modules / util / util.js:602 599 | 600 | exports.promisify =函数promisify(原始){ 601 | if(typeof original!=='function')
602 |抛出新的TypeError('“原始”参数必须为Function类型'); 603 | 604 |如果(kCustomPromisifiedSymbol &&原始[kCustomPromisifiedSymbol]){ 605 | var fn = original [kCustomPromisifiedSymbol];
// next.config.js
const withSass = require('@zeit/next-sass');
module.exports = withSass({
/* config options here */
});
module.exports = {
webpack: config => {
config.node = {
fs: 'empty',
child_process: 'empty',
net: 'empty',
dns: 'empty',
tls: 'empty',
};
return config;
},
};
// packege.json
> "dependencies": {
> "@types/react-intl": "^3.0.0",
> "@types/react-lottie": "^1.2.3",
> "@zeit/next-sass": "^1.0.1",
> "child_process": "^1.0.2",
> "googleapis": "^49.0.0",
> "isomorphic-unfetch": "^3.0.0",
> "next": "^9.2.1",
> "node-sass": "^4.13.1",
> "react": "^16.12.0",
> "react-dom": "^16.12.0",
> "react-intl": "^3.12.0",
> "react-lottie": "^1.2.3" }, "devDependencies": {
> "@types/node": "^13.7.0",
> "@types/react": "^16.9.19",
> "typescript": "^3.7.5" }