我正在尝试将我的8号角代码迁移到9号角。
启动服务器时,我看到以下错误。
更新正常。请对此错误提出一些建议。
提前谢谢!
ERROR in /Users/ert/Documents/file/node_modules/ng2-pdf-viewer/__ivy_ngcc__/node_modules/pdfjs-dist/build/pdf.js
Module not found: Error: Can't resolve 'fs' in '/Users/ert/Documents/file/node_modules/ng2-pdf-viewer/__ivy_ngcc__/node_modules/pdfjs-dist/build'
ERROR in /Users/ert/Documents/file/node_modules/ng2-pdf-viewer/__ivy_ngcc__/node_modules/pdfjs-dist/build/pdf.js
Module not found: Error: Can't resolve 'http' in '/Users/ert/Documents/file/node_modules/ng2-pdf-viewer/__ivy_ngcc__/node_modules/pdfjs-dist/build'
ERROR in /Users/ert/Documents/file/node_modules/ng2-pdf-viewer/__ivy_ngcc__/node_modules/pdfjs-dist/build/pdf.js
Module not found: Error: Can't resolve 'https' in '/Users/ert/Documents/file/node_modules/ng2-pdf-viewer/__ivy_ngcc__/node_modules/pdfjs-dist/build'
答案 0 :(得分:0)
在Angular 8项目中添加PDF Js库时遇到了同样的问题。您可以在package.json
中添加以下代码,它将解决该错误。
{
"scripts": { },
"dependencies": { },
"devDependencies": { },
"browser": {
"fs": false
}
}