4

i have the following package.json code:

{
    "name": "pre-post",
    "version": "1.0.0",
    "description": "",
    "main": "basic-server.js",
    "scripts": {
      "test": "echo \"Error: no test specified\" && exit 1",
      "ignore": "echo \"\" >> .gitignore",
      "preignore": "touch .gitignore",
      "postignore": "echo \".gitignore\n.vscode/\nnode_modules/\" >> .gitignore"
    },
    "keywords": [],
    "author": "",
    "license": "ISC",
    "dependencies": {
      "linebreak": "^1.0.2",
      "open": "^7.4.0"
    }
}

after i run in node js command, i have the error message of npm ERR! Line breaks can't be quoted on Windows, any fix?

Nishant
  • 54,584
  • 13
  • 112
  • 127
bim2016
  • 105
  • 1
  • 10

5 Answers5

3

Check whether your package.json have swiper

There are 4 steps to solve this problem

  1. Remove "swiper" : "^5.4.5" from package.json file.(Check there should be no comma in last line of your json file)
  2. Run npm install command in your terminal.
  3. Run npm install swiper command.
  4. Now you will see everything has been installed successfully.
TGnat
  • 3,903
  • 8
  • 35
  • 46
Harsh Soni
  • 49
  • 4
0

Just don't install it from Git Bash on Windows. Use cmd.exe and it works as a charm !

mBbkr
  • 212
  • 3
  • 13
-1
  1. Uninstall node.js from Control Panel/Programs
  2. Download fresh node.js installer and install them.
  3. (important) reboot system.
Alexey Victorov
  • 432
  • 2
  • 10
-1

I face the same problem and this thing is work for me

  1. Uninstall node completely use this answer
  2. reboot your device
  3. download again from official website
-1

Use yarn to install the dependencies. Solved for me.

subha chanda
  • 21
  • 1
  • 13