Joseph
Joseph

Reputation: 3959

Unable to install express-generator at all (only on laptop, desktop is fine)

I am trying to get up and running with express for node.js but I am running into problems at the installation stage.

I have installed node fine, and npm is working ok.

Machine: windows 7 on macbook air 2011

I first tried to install express via npm install -g express but was met with error after error, not so simple I guess. I followed some advice on the express website to create a package.json file in the directory I wanted to install express to, so I did that:

package.json:

{
  "name": "tutorial",
  "description": "tutorial test app",
  "version": "0.0.1",
  "private": true,
  "dependencies": {
    "express": "4.x"
  }
}

I then hit npm install and finally express installed into the directory (where the npm command and package.json were situated)

Now I try npm install -g express-generator as per the instructions at Express Guide however I am simply met with the same errors that I was getting before:

c:\code\node\tutorial>npm install -g express-generator
C:\Users\JosephGoss\AppData\Roaming\npm\express -> C:\Users\JosephGoss\AppData\Roaming\npm\node_modules\express-generato
r\bin\express
npm ERR! peerinvalid The package flatiron does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants flatiron@~0.1.9
npm ERR! peerinvalid Peer [email protected] wants flatiron@~0.1.9

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js"
 "install" "-g" "express-generator"
npm ERR! cwd c:\code\node\tutorial
npm ERR! node -v v0.10.31
npm ERR! npm -v 1.4.23
npm ERR! code EPEERINVALID
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     c:\code\node\tutorial\npm-debug.log
npm ERR! not ok code 0

I have searched around and could not find another install express tutorial that dealt with this issue.

EDIT: I have just tried to run npm install -g express and npm install -g express-generator on my desktop computer (windows 7 on an i7) and everything works fine.

I'll leave this up incase anyone knows why my laptop can't run npm install properly.

Upvotes: 1

Views: 1133

Answers (2)

Wilson Wu
Wilson Wu

Reputation: 2018

Try to use sudo before your command, example:

npm install -g express-generator

Upvotes: 0

Joseph
Joseph

Reputation: 3959

It seems I must of had left over stuff installed from a few years ago when I last used node. an old Jitsu installation seemed to be causing my problems on my laptop.

See here

I uninstalled jitsu:

c:\code\node\tutorial>npm uninstall -g jitsu
unbuild [email protected]

And now everything works.

Upvotes: 1

Related Questions