Skip to content

Cannot set property to of [object String] which has only a getter #752

@ilex0208

Description

@ilex0208

Node version (or tell us if you're using electron or some other framework):6.11

ShellJS version (the most recent version/Github branch you see the bug on):0.7.8

Operating system:windows10

Description of the bug:Cannot set property to of [object String] which has only a getter

Example ShellJS command to reproduce the error: shelljs.rm

gulp.task('clean', () => {
  if (fs.existsSync(resolveCwd('lib'))) {
    shelljs.rm('-rf', resolveCwd('lib'));
  }
});

the error details is:
pipeMethods: [ 'cat','exec','grep', 'head', 'sed','sort','tail', 'to', 'toEnd', 'uniq' ]
cmd cat
cmd exec
cmd grep
cmd head
cmd sed
cmd sort
cmd tail
cmd to
error TypeError: Cannot set property to of [object String] which has only a getter
cmd toEnd
cmd uniq

that is to say, the 'to' method cannot set property!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions