我安装了一个使用其browser.js文件中的下一行的js包fs-constants。
module.exports = require('constants')我在编译时得到这个错误
ERROR in ./node_modules/fs-constants/browser.js
Module not found: Error: Can't resolve 'constants' in '/mnt/c/Users/jbermudez/workspace/HMI_WEB_CONVERTIDORES/front/node_modules/fs-constants'我检查了我是否安装了一个名为constants-browserify的包,但它似乎没有解决问题
发布于 2020-08-27 16:25:18
嗯,fs-constants模块依赖于另一个名为常量的模块,正如该模块的npm站点声明的那样,该模块现在已被弃用。这现在是使用require("fs").constants调用的,但是这是仅节点的。您使用的是哪个Node版本?在v12.18中,常量模块仍然存在,并且对我来说是可调用的。
https://stackoverflow.com/questions/63611600
复制相似问题