Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 错误:Can';t解决';常数';常数fs_Angular_Typescript_Browserify - Fatal编程技术网

Angular 错误:Can';t解决';常数';常数fs

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

我安装了一个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_modules/fs-constants'

我检查过是否安装了一个名为constants browserify的包,但它似乎无法解决问题。

嗯,
fs constants
模块依赖另一个名为constants的模块,该模块现在已被弃用,正如模块本身的npm站点所述。现在使用
require(“fs”).constants
来调用它,但这只是节点。您使用的是哪个节点版本?截至
v12.18
,常量模块仍然存在,可以为我调用。

14.0我明白了,正如您所说,非浏览器提到的使用module.exports=require('fs')。常量| | require('constants'),但浏览器中的同一句话js不能解决问题