Angular 错误:Can';t解决';常数';常数fs
我安装了一个js包,它使用browser.js文件中的下一行Angular 错误:Can';t解决';常数';常数fs,angular,typescript,browserify,Angular,Typescript,Browserify,我安装了一个js包,它使用browser.js文件中的下一行 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
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的包,但它似乎无法解决问题。嗯,
fs constants
模块依赖另一个名为constants的模块,该模块现在已被弃用,正如模块本身的npm站点所述。现在使用require(“fs”).constants
来调用它,但这只是节点。您使用的是哪个节点版本?截至v12.18
,常量模块仍然存在,可以为我调用。14.0我明白了,正如您所说,非浏览器提到的使用module.exports=require('fs')。常量| | require('constants'),但浏览器中的同一句话js不能解决问题