Skip to content
This repository has been archived by the owner on Jul 6, 2019. It is now read-only.

error message: 'TypeError: rimraf.sync is not a function' in version 9.0.7 #61

Closed
Teamop opened this issue Jul 11, 2017 · 2 comments
Closed
Labels

Comments

@Teamop
Copy link

Teamop commented Jul 11, 2017

Platform: windows 7
npx: v9.0.7
npm: v5.2.0
node: v6.9.5
shell: CMD.EXE

I have installed the npx globally, then want to try some features, but got the error: 'TypeError: rimraf.sync is not a function'.
image

@katemihalikova
Copy link
Collaborator

The last issue from Windows trilogy (#60, #58 and #61) 🔱

This is fairly easy to solve: rimraf package is being promisified and the returned function does not have the other properties like sync that were on the original function. Using non-promisified rimraf for this solves the problem.

  : path.join(prefix, 'bin')
- const rimraf = promisify(require('rimraf'))
+ const rimraf = require('rimraf')
  process.on('exit', () => rimraf.sync(prefix))
- return rimraf(bins).then(() => {
+ return promisify(rimraf)(bins).then(() => {
    return installPackages(specs, prefix, opts)

@zkat
Copy link
Owner

zkat commented Jul 11, 2017

😊 yeah I'll just roll a patch for this. It was p obvs when I saw it.

@zkat zkat closed this as completed in d2ecba3 Jul 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants