【npm install】Npm ERR! Line breaks can’t be quoted on Windows

原创
2021/12/19 03:43
阅读数 450
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>

处理步骤

原文

  1. go to the script mentioned in the error (‘C:\Program Files\nodejs\node_modules\npm\node_modules\puka\index.js’)
  2. Look for the line: throw new Error(“Line breaks can’t be quoted on Windows”) in the function quoteForCmd and comment it.
  3. type the following code: text.replace(/[\n\r]/,’ ') bellow the commented line;
  4. Save the file.
  5. Run the npm script again.

翻译

  1. 找到这个报错的文件 (C:\Program Files\nodejs\node_modules\npm\node_modules\puka\index.js)
  2. 找到这一行: throw new Error(“Line breaks can’t be quoted on Windows”) 注释掉他
  3. 然后在他的下面写上这一行: text.replace(/[\n\r]/,'')
  4. 保存
  5. 重新 npm install
展开阅读全文
加载中

作者的其它热门文章

打赏
0
0 收藏
分享
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部