7

downloaded mean stck zip from mean.io did an npm install after few minutes I got an error. Please see screenshot. what do I do?

screenshot

npm http 200 https://registry.npmjs.org/event-emitter/-/event-e
mitter-0.2.2.tgz

> mean@1.0.0 postinstall C:\ss\D1\google\04\mean\mean-stack
> ./node_modules/bower/bin/bower install

'.' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! weird error 1
npm ERR! not ok code 0
fracz
  • 20,536
  • 18
  • 103
  • 149
user2712585
  • 153
  • 1
  • 2
  • 5

4 Answers4

6

Looks like mean stacks postinstall script is hardcoded with Unix style paths. In Unix ./somethig/or/another signifies accessing the something directory starting HERE (the meaning of .).

I'd suggest submitting a bug on their GitHub page to start. Then you might be able to get away with editing the package.json to have the post install script use Windows style paths. It would be something like node_modules\bower\bin\bower install. I don't have windows so cannot say for certain.

Morgan ARR Allen
  • 10,556
  • 3
  • 35
  • 33
  • 3
    changing the path to windows style worked for me. Note you have to double up the slashes: node_modules\\bower\\bin\\bower . Unfortunateally I need this work work on both unix and windows – rob Sep 27 '13 at 03:54
4

If you want to call something from node_modules/bin, you don't have to point at it directly. You can just call the tool by name in NPM script definition, i.e.:

"postinstall": "bower install"
fracz
  • 20,536
  • 18
  • 103
  • 149
  • Doesn't work for me. Unfortunately Windows PowerShell tells me "bower is not recognized", but I've `npm install`ed everything. Any ideas what to try? – trusktr Feb 18 '19 at 02:35
2

The postinstall doesn't work really well now for this repository on Windows. Try to run npm install -g bower and then bower install in the project's folder. It should do the same thing without postinstall.

John Doe
  • 9,414
  • 13
  • 50
  • 69
1

I was getting same error while running npm run env.

> ergonode-front@1.1.0 env
> ./lib/index.js env

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

What I did was manually going to directory and run the command. Like this,

cd ./lib
node index.js env
Taslim Oseni
  • 6,086
  • 10
  • 44
  • 69
Sanjuwa
  • 43
  • 1
  • 6