Programing

빠른 명령을 찾을 수 없습니다

lottogame 2020. 6. 27. 10:59
반응형

빠른 명령을 찾을 수 없습니다


디렉토리 에 Express 를 실행하고 Express를 실행하려고 npm install -g express하면 내 컴퓨터에 Express를 설치 한 후 어떤 이유로 든 cd다음과 같은 오류가 발생합니다.

express: command not found. 

내가 그것을 실행하더라도 sudo여전히 동일한 출력을 얻습니다. 이 문제에 대한 여러 가지 다른 솔루션을 시도했지만 아무런 효과가 없습니다. 나는 통해 노드에 설치 한 homebrew나는 완전히 노드를 제거하고 nodejs.org에서 설치 (지금 v0.10.26을 실행 해요) 여전히 문제이 지속 통해 다시 설치할 수 있도록 스택 오버플로 일부 스레드가 문제가되었을 수 있습니다 표시하는합니다.

/usr/local/lib/node_modulesExpress에 들어가면 / usr / local / bin 내에 Express에 관한 것이 없습니다. 그것이 문제인지 아닌지는 확실하지 않지만 해당 디렉토리에 다른 전역 적으로 설치된 노드 패키지에 대한 바이너리가 있다고 생각하면 거기에 문제가 있다고 생각합니다.

이것은 내가 설치할 때 얻는 정확한 결과입니다.

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)

Express 4.0.0이 출시되면해야 할 것처럼 보입니다 sudo npm install -g express-generator.


다음을 실행해야합니다.

npm install -gd express-generator

The original express with cli, now the cli split into separate express-generator package. Originally generated by the project is running express node app.js, because httpserver relevant code in app.js, and now this part of the code to the project directory bin/www below, app.js retain only achieve app logic code, you need to run the bin/www. Just a very simple application and refinement package dependency version changes.


I was having this challenge for a number of days. After deep search, I learned that one has to read every available resource especially from the parent source [in this case EXPRESSJS.COM]. Here is a quick fix.

Beginning with version 4.0+ you don't necessarily need to install express-generator if you are running Node 8.2+. Simply run

npx express-generator

The express-generator will run just the way it runs when you run:express

For more details see Getting Started

Happy reading and research hours.

참고URL : https://stackoverflow.com/questions/23002448/express-command-not-found

반응형