Skip to content

Bug Report: Postinstall Failed on Windows 10 #376

@arnydo

Description

@arnydo

Summary

When running "npm install" on Windows 10 the following error is generated:

'[' is not recognized as an internal or external command,
operable program or batch file.

Example

  1. Install Git
    
  2. Install Node.js and its package manager, npm
    
  3. Install Grunt: npm install -g grunt-cli
    
  4. git clone https://github.com/gchq/CyberChef.git
    
  5. cd CyberChef
    
  6. npm install
    

Error:

npm install

> cyberchef@8.7.0 postinstall C:\CyberChef
> [ -f node_modules/crypto-api/src/crypto-api.mjs ] || npx j2m node_modules/crypto-api/src/crypto-api.js

'[' is not recognized as an internal or external command,
operable program or batch file.
Failed to parse: C:\CyberChef\node_modules\crypto-api\src\crypto-api.js
{ Error: ENOENT: no such file or directory, open 'C:\CyberChef\node_modules\crypto-api\src\crypto-api.js'
    at Object.openSync (fs.js:436:3)
    at readFileSync (fs.js:341:35)
    at parseImports (C:\CyberChef\node_modules\js-to-mjs\src\find.js:36:16)
    at main (C:\CyberChef\node_modules\js-to-mjs\index.js:18:25)
    at Object.<anonymous> (C:\CyberChef\node_modules\js-to-mjs\index.js:61:1)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
  errno: -4058,
  syscall: 'open',
  code: 'ENOENT',
  path:
   'C:\CyberChef\\node_modules\\crypto-api\\src\\crypto-api.js' }
ENOENT: no such file or directory, rename 'C:\CyberChef\node_modules\crypto-api\src\crypto-api.js' -> 'C:\CyberChef\node_modules\crypto-api\src\crypto-api.mjs'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! cyberchef@8.7.0 postinstall: `[ -f node_modules/crypto-api/src/crypto-api.mjs ] || npx j2m node_modules/crypto-api/src/crypto-api.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the cyberchef@8.7.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\me\AppData\Roaming\npm-cache\_logs\2018-10-04T20_58_38_712Z-debug.log

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