Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/2.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
Node.js 模块构建失败(来自./node\u modules/postss loader/src/index.js)_Node.js_Angular - Fatal编程技术网

Node.js 模块构建失败(来自./node\u modules/postss loader/src/index.js)

Node.js 模块构建失败(来自./node\u modules/postss loader/src/index.js),node.js,angular,Node.js,Angular,我正在使用angular和node,当我运行命令npm start时,我得到了这个错误 ./src/styles.scss中出错(./node_modules/css loader/dist/cjs.js??ref--13-1!。/node_modules/postss loader/src??embedded!。/node_modules/sass loader/dist/cjs??ref--13-3!。/src/styles.scss) 模块构建失败(来自./node\u modules/p

我正在使用angular和node,当我运行命令
npm start
时,我得到了这个错误

./src/styles.scss中出错(./node_modules/css loader/dist/cjs.js??ref--13-1!。/node_modules/postss loader/src??embedded!。/node_modules/sass loader/dist/cjs??ref--13-3!。/src/styles.scss) 模块构建失败(来自./node\u modules/postss loader/src/index.js): 错误:enoint:没有这样的文件或目录,请打开“…\node”_modules@angular\材质\预构建主题\靛蓝粉.css' 在Object.openSync(fs.js:457:3) 在Object.readFileSync(fs.js:359:35) 位于Storage.provideSync(…\node\u modules\enhanced resolve\lib\CachedInputFileSystem.js:109:13) 在CachedInputFileSystem.readFileSync(…\node\u modules\enhanced resolve\lib\CachedInputFileSystem.js:289:32) 在可观察状态下。\u订阅(…\node)_modules@ngtools\webpack\src\webpack input host.js:35:51)

我曾尝试查看一些类似的帖子,但没有解决方案。我的node.js版本是

v12.16.1

我的角度是

角度CLI:9.1.9 节点:12.16.1 操作系统:win32 x64


我建议使用节点10,因为它更适合角度9。你可以很容易地使用

然后您可以尝试以下步骤

  • rm-射频节点单元模块
  • npm i—保存精确的
  • ng s

如果您使用的是angular,并且以下操作不起作用

@import "../node_modules/ag-grid-community/dist/styles/ag-grid.css";
@import "../node_modules/ag-grid-community/dist/styles/ag-theme-alpine.css";
然后在angular.json文件中尝试以下内部样式数组

“样式”:[
“src/styles.scss”、
“node\u modules/ag grid community/dist/styles/ag grid.css”、“node\u modules/ag grid community/dist/styles/ag theme.css”、 ]

这是一个有效的例子。