我有一个Angular CLI项目,我刚刚升级到Angular 6.现在,当我尝试构建我的应用程序时,出现以下错误:
ERROR in ./node_modules/postcss/lib/input.js
Module not found: Error: Can't resolve 'path' in '/Users/jattardi/code/myproject/node_modules/postcss/lib'
ERROR in ./node_modules/postcss/lib/map-generator.js
Module not found: Error: Can't resolve 'path' in '/Users/jattardi/code/myproject/node_modules/postcss/lib'
ERROR in ./node_modules/postcss/lib/previous-map.js
Module not found: Error: Can't resolve 'path' in '/Users/jattardi/code/myproject/node_modules/postcss/lib'
ERROR in ./node_modules/htmlparser2/lib/WritableStream.js
Module not found: Error: Can't resolve 'stream' in '/Users/jattardi/code/myproject/node_modules/htmlparser2/lib'
我很困惑。首先,我甚至没有直接在我的项目中使用postcss
或htmlparser2
。所以他们必须是其他东西的依赖。
但是节点模块中没有path
和stream
吗?怎么可能无法解决它们?
答案 0 :(得分:9)
npm install path
npm install stream
成功了