使用离子cli生成管道文件
(Get-ChildItem -Path $Folder -Recurse -Include *.txt).FullName -match $filterPattern
导致以下错误:
ionic g pipe example
答案 0 :(得分:2)
生成管道时出现“Error: ENOENT: no such file or directory, open '<PROJECT_PATH>/src/PIPES/example.module.ts'
at Object.fs.openSync (fs.js:652:18)
at Object.fs.writeFileSync (fs.js:1299:33)
at createCommonModule (/home/future/Projects/SmartUpCode/smartupcrm-mobile/node_modules/@ionic/app-scripts/dist/generators/util.js:77:10)
at Object.<anonymous> (<PROJECT_PATH>/node_modules/@ionic/app-scripts/dist/generators/util.js:238:29)
at step (<PROJECT_PATH>e/node_modules/@ionic/app-scripts/dist/generators/util.js:32:23)
at Object.next (<PROJECT_PATH>/node_modules/@ionic/app-scripts/dist/generators/util.js:13:53)
at fulfilled (<PROJECT_PATH>/node_modules/@ionic/app-scripts/dist/generators/util.js:4:58)
at <anonymous>
”错误是因为在本机Error: ENOENT: no such file or directory,
文件中使用了错误的目录路径。
node_modules&gt; @ionic&gt; app-scripts&gt; dist&gt; util&gt; config.js文件
问题可以通过将路径中的大写'PIPES'名称更改为LOWERCASE'pipes'来生成example.module.ts文件来解决;
ionic config.js
(context.srcDir,'pipes','pipes.module.ts')
然后它运作良好......