Skip to content
This repository was archived by the owner on Aug 11, 2022. It is now read-only.
This repository was archived by the owner on Aug 11, 2022. It is now read-only.

Install error: Unexpected token < in JSON at position 35 #17340

@joshfarrant

Description

@joshfarrant

I'm opening this issue because:

  • npm is crashing.
  • npm is producing an incorrect install.
  • npm is doing something I don't understand.
  • Other (see below for feature requests):

What's going wrong?

Running npm i within a certain project produces the following error.

npm ERR! Unexpected token < in JSON at position 35

From the debug.log it appears that npm is trying to read the load the shrinkwrap and failing. It's worth noting that this issue only occurs in this project on my current machine. I've tested on another Fedora 22 machine, (same npm and node versions) and the install works as expected. I appreciate this points to my local environment being the cause, however it looks like there may be some invalid syntax (<) stuck in a config file somewhere that shouldn't be there and that I am unable to clear. Here is the package.json for this project.

How can the CLI team reproduce the problem?

I'm unsure how to suggest reproduction of the issue, however I'm happy to test any suggestions anyone offers and report back.

supporting information:

  • npm -v prints: 5.0.3
  • node -v prints: 8.0.0
  • npm config get registry prints: https://registry.npmjs.org/
  • Windows, OS X/macOS, or Linux?: Linux (Fedora 22)
  • Network issues:
    • Geographic location where npm was run: United Kingdom
    • I use a proxy to connect to the npm registry.
    • I use a proxy to connect to the web.
    • I use a proxy when downloading Git repos.
    • I access the npm registry via a VPN
    • I don't use a proxy, but have limited or unreliable internet access.
  • Container:
    • I develop using Vagrant on Windows.
    • I develop using Vagrant on OS X or Linux.
    • I develop / deploy using Docker.
    • I deploy to a PaaS (Triton, Heroku).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions