yarn crash on install pacakge

Created on 14 Feb 2017  路  8Comments  路  Source: yarnpkg/yarn

Do you want to request a feature or report a bug?
Report a bug

What is the current behavior?

error An unexpected error occurred: "Unknown token 92:1".

Log

Trace:
  SyntaxError: Unknown token 92:1
      at Parser.unexpected (/usr/local/lib/node_modules/yarn/updates/0.19.1/lib/lockfile/parse.js:224:11)
      at Parser.parse (/usr/local/lib/node_modules/yarn/updates/0.19.1/lib/lockfile/parse.js:329:14)
      at exports.default (/usr/local/lib/node_modules/yarn/updates/0.19.1/lib/lockfile/parse.js:13:17)
      at /usr/local/lib/node_modules/yarn/updates/0.19.1/lib/lockfile/wrapper.js:129:60
      at next (native)
      at step (/usr/local/lib/node_modules/yarn/updates/0.19.1/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
      at /usr/local/lib/node_modules/yarn/updates/0.19.1/node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13

If the current behavior is a bug, please provide the steps to reproduce.

yarn add babel-plugin-transform-remove-console-enhance --dev

What is the expected behavior?
add package

Please mention your node.js, yarn and operating system version.
OS: MacOS 10.12.3
node: v6.8.0
yarn: v0.19.1

Most helpful comment

Started running into a similar issue after the update to Yarn 0.20 on Debian Jessie:

Arguments:
  /usr/bin/nodejs /usr/share/yarn/bin/yarn.js add nativescript

PATH:
  /opt/local/bin:/opt/local/sbin:/usr/local/opt/go/libexec/bin:/google-cloud-sdk/bin:/google-cloud-sdk/platform/google_appengine:/google-cloud-sdk/platform/google_appengine/google/appengine/tools:/home/gibson/go/bin:/home/gibson/androidsdk/platform-tools:/home/gibson/androidsdk/tools:/home/gibson/.rvm/gems/ruby-2.4.0/bin:/home/gibson/.rvm/gems/ruby-2.4.0@global/bin:/home/gibson/.rvm/rubies/ruby-2.4.0/bin:/home/gibson/emsdk_portable:/home/gibson/emsdk_portable/clang/fastcomp/build_master_64/bin:/home/gibson/emsdk_portable/node/4.1.1_64bit/bin:/home/gibson/emsdk_portable/emscripten/master:/google-cloud-sdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/gibson/.rvm/bin:/node_modules/.bin:/home/gibson/.rvm/bin

Yarn version:
  0.20.3

Node version:
  6.9.5

Platform:
  linux x64

npm manifest:
  No manifest

yarn manifest:
  No manifest

Lockfile:
  No lockfile

Trace:
  Error: ENOENT: no such file or directory, lstat '/home/gibson/balls/node_modules/nodobjc/node_modules'
      at Error (native)
      at Object.fs.lstatSync (fs.js:982:18)
      at Object.realpathSync (fs.js:1662:21)
      at /usr/share/yarn/lib/util/fs.js:377:80
      at throw (native)
      at step (/usr/share/yarn/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
      at /usr/share/yarn/node_modules/babel-runtime/helpers/asyncToGenerator.js:30:13

All 8 comments

Can't repro on latest yarn and 0.19.1

bestander-pro:2692 bestander$ yarn add babel-plugin-transform-remove-console-enhance --dev
yarn add v0.21.0-0
info No lockfile found.
[1/4] 馃攳  Resolving packages...
[2/4] 馃殮  Fetching packages...
[3/4] 馃敆  Linking dependencies...
[4/4] 馃搩  Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
鈹斺攢 [email protected]

Try removing self-update folder rm -rf /usr/local/lib/node_modules/yarn/updates/

@bestander I remove yarn.lock file and re-run yarn, everything is ok.

Started running into a similar issue after the update to Yarn 0.20 on Debian Jessie:

Arguments:
  /usr/bin/nodejs /usr/share/yarn/bin/yarn.js add nativescript

PATH:
  /opt/local/bin:/opt/local/sbin:/usr/local/opt/go/libexec/bin:/google-cloud-sdk/bin:/google-cloud-sdk/platform/google_appengine:/google-cloud-sdk/platform/google_appengine/google/appengine/tools:/home/gibson/go/bin:/home/gibson/androidsdk/platform-tools:/home/gibson/androidsdk/tools:/home/gibson/.rvm/gems/ruby-2.4.0/bin:/home/gibson/.rvm/gems/ruby-2.4.0@global/bin:/home/gibson/.rvm/rubies/ruby-2.4.0/bin:/home/gibson/emsdk_portable:/home/gibson/emsdk_portable/clang/fastcomp/build_master_64/bin:/home/gibson/emsdk_portable/node/4.1.1_64bit/bin:/home/gibson/emsdk_portable/emscripten/master:/google-cloud-sdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/gibson/.rvm/bin:/node_modules/.bin:/home/gibson/.rvm/bin

Yarn version:
  0.20.3

Node version:
  6.9.5

Platform:
  linux x64

npm manifest:
  No manifest

yarn manifest:
  No manifest

Lockfile:
  No lockfile

Trace:
  Error: ENOENT: no such file or directory, lstat '/home/gibson/balls/node_modules/nodobjc/node_modules'
      at Error (native)
      at Object.fs.lstatSync (fs.js:982:18)
      at Object.realpathSync (fs.js:1662:21)
      at /usr/share/yarn/lib/util/fs.js:377:80
      at throw (native)
      at step (/usr/share/yarn/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
      at /usr/share/yarn/node_modules/babel-runtime/helpers/asyncToGenerator.js:30:13

Yeah, I can repro @buu700's error, it is a duplicate of https://github.com/yarnpkg/yarn/issues/2714.

@Riokai, can you do rm -rf /usr/local/lib/node_modules/yarn/updates?
This should sort out issue with self-update feature that we removed now.

@bestander Okay

@bestander the duplicate is closed, can we close this?

Was this page helpful?
0 / 5 - 0 ratings