PS E:\project\out_work\pc-v1> npm install swiper
npm ERR! Line breaks can't be quoted on Windows
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Tensai\AppData\Local\npm-cache\_logs\2021-12-18T19_18_34_550Z-debug.log
PS E:\project\out_work\pc-v1> npm install joi
npm ERR! Line breaks can't be quoted on Windows
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Tensai\AppData\Local\npm-cache\_logs\2021-12-18T19_19_05_960Z-debug.log
PS E:\project\out_work\pc-v1>
处理步骤
原文
- go to the script mentioned in the error (‘C:\Program Files\nodejs\node_modules\npm\node_modules\puka\index.js’)
- Look for the line: throw new Error(“Line breaks can’t be quoted on Windows”) in the function quoteForCmd and comment it.
- type the following code: text.replace(/[\n\r]/,’ ') bellow the commented line;
- Save the file.
- Run the npm script again.
翻译
- 找到这个报错的文件 (
C:\Program Files\nodejs\node_modules\npm\node_modules\puka\index.js
)
- 找到这一行:
throw new Error(“Line breaks can’t be quoted on Windows”)
注释掉他
- 然后在他的下面写上这一行:
text.replace(/[\n\r]/,'')
- 保存
- 重新
npm install