Per qualche motivo dopo aver installato Express a livello globale sul mio computer con npm install -g express
se cd
in una directory e provo a eseguire express ottengo il seguente errore:
express: command not found.
Anche se lo eseguo, sudo
ottengo sempre lo stesso output. Ho provato diverse soluzioni a questo problema e nulla ha funzionato. Avevo installato il nodo tramite il homebrew
quale alcuni thread su Stack Overflow indicato potevano essere un problema, quindi ho disinstallato completamente il nodo e reinstallato tramite il programma di installazione su nodejs.org (sto eseguendo v0.10.26) e il problema persiste ancora.
Se entro nel mio /usr/local/lib/node_modules
Express c'è dentro ma dentro / usr / local / bin non c'è nulla riguardo Express. Non sono sicuro che si tratti di un problema o meno, ma considerando che ci sono binari per altri pacchetti di nodi installati a livello globale in quella directory, penso che ci possa essere qualcosa di sbagliato lì.
Questo è l'output esatto che ottengo quando installo:
npm http GET https://registry.npmjs.org/express
npm http 304 https://registry.npmjs.org/express
npm http GET https://registry.npmjs.org/accepts/1.0.0
npm http GET https://registry.npmjs.org/type-is/1.0.0
npm http GET https://registry.npmjs.org/range-parser/1.0.0
npm http GET https://registry.npmjs.org/cookie/0.1.0
npm http GET https://registry.npmjs.org/fresh/0.2.2
npm http GET https://registry.npmjs.org/buffer-crc32/0.2.1
npm http GET https://registry.npmjs.org/send/0.2.0
npm http GET https://registry.npmjs.org/methods/0.1.0
npm http GET https://registry.npmjs.org/cookie-signature/1.0.3
npm http GET https://registry.npmjs.org/utils-merge/1.0.0
npm http GET https://registry.npmjs.org/merge-descriptors/0.0.2
npm http GET https://registry.npmjs.org/escape-html/1.0.1
npm http GET https://registry.npmjs.org/serve-static/1.0.1
npm http GET https://registry.npmjs.org/qs/0.6.6
npm http GET https://registry.npmjs.org/path-to-regexp/0.1.2
npm http GET https://registry.npmjs.org/parseurl/1.0.1
npm http GET https://registry.npmjs.org/debug
npm http 304 https://registry.npmjs.org/cookie/0.1.0
npm http 304 https://registry.npmjs.org/type-is/1.0.0
npm http 304 https://registry.npmjs.org/buffer-crc32/0.2.1
npm http 304 https://registry.npmjs.org/methods/0.1.0
npm http 304 https://registry.npmjs.org/accepts/1.0.0
npm http 304 https://registry.npmjs.org/range-parser/1.0.0
npm http 304 https://registry.npmjs.org/cookie-signature/1.0.3
npm http 304 https://registry.npmjs.org/fresh/0.2.2
npm http 304 https://registry.npmjs.org/serve-static/1.0.1
npm http 304 https://registry.npmjs.org/qs/0.6.6
npm http 304 https://registry.npmjs.org/utils-merge/1.0.0
npm http 304 https://registry.npmjs.org/merge-descriptors/0.0.2
npm http 304 https://registry.npmjs.org/escape-html/1.0.1
npm http 304 https://registry.npmjs.org/path-to-regexp/0.1.2
npm http 304 https://registry.npmjs.org/parseurl/1.0.1
npm http 304 https://registry.npmjs.org/debug
npm http 304 https://registry.npmjs.org/send/0.2.0
npm http GET https://registry.npmjs.org/mime
npm http GET https://registry.npmjs.org/send/0.1.4
npm http GET https://registry.npmjs.org/mime
npm http GET https://registry.npmjs.org/negotiator
npm http 304 https://registry.npmjs.org/mime
npm http 304 https://registry.npmjs.org/mime
npm http 304 https://registry.npmjs.org/send/0.1.4
npm http GET https://registry.npmjs.org/range-parser/0.0.4
npm http GET https://registry.npmjs.org/fresh/0.2.0
npm http 304 https://registry.npmjs.org/negotiator
npm http 304 https://registry.npmjs.org/range-parser/0.0.4
npm http 304 https://registry.npmjs.org/fresh/0.2.0
express@4.0.0 /usr/local/lib/node_modules/express
├── methods@0.1.0
├── parseurl@1.0.1
├── utils-merge@1.0.0
├── merge-descriptors@0.0.2
├── escape-html@1.0.1
├── debug@0.8.0
├── cookie-signature@1.0.3
├── range-parser@1.0.0
├── fresh@0.2.2
├── qs@0.6.6
├── buffer-crc32@0.2.1
├── cookie@0.1.0
├── path-to-regexp@0.1.2
├── type-is@1.0.0 (mime@1.2.11)
├── send@0.2.0 (mime@1.2.11)
├── serve-static@1.0.1 (send@0.1.4)
└── accepts@1.0.0 (negotiator@0.3.0, mime@1.2.11)