gulp 명령을 찾을 수 없음-gulp 설치 후 오류
나는 전 세계적으로 로컬로 gulp를 설치했습니다.
npm install gulp
npm install gulp -g
npm install gulp-util
npm install gulp-util -g
꿀꺽 꿀꺽 마시려고하면 얻을
'gulp' is not recognized as an internal or external command, operable program or batch file.
npm list gulp (또는 -g)를 실행 gulp@3.7.0
하면 전역 또는 로컬 gulp 설치 위치가 있습니다.
node gulpfile.js
gulpfile을 가리키고 실행을 시도했지만 오류없이 실행되며 물론 시작됩니다 require('gulp')
.
Windows (8.1)에서 꿀꺽 꿀꺽 만드는 일에 대한 제안?
gulp-cli 패키지 설치를 잊었습니다 :
npm install -g gulp-cli
그런 다음 명령 행에서 "gulp"명령을 실행할 수 있습니다.
이 질문에서 문제와 답변을 찾을 수 있습니다 : https://stackoverflow.com/a/9588052/1041104
gulp와 같은 npm 모듈이 경로에 설치되지 않았습니다. 따라서 CMD에서 실행할 때 찾을 수 없습니다.
gulp가 전체적으로 설치된 경우 아래 프로세스를 사용할 수 있습니다.
- 라는 환경 변수를 만듭니다
NODE_PATH
- 다음으로 설정하십시오.
%AppData%\npm\node_modules
또는%AppData%\npm
Windows 8-10 - CMD를 닫고 다시 열어서 새로운 ENV 변수를 얻습니다.
실행 npm ls
및 npm ls -g
쇼 그들이 설치되어 있지만, CMD는 때문에 그들을 찾을 수 없습니다 the missing link
.
- 꿀꺽 꿀꺽해야하며
gulp.cmd
(창 검색 사용) - ( ) 의 경로를 복사
gulp.cmd
C:\Users\XXXX\AppData\Roaming\npm
- 이 경로를 경로 환경 변수에 추가 하거나
PATH
환경 변수를 편집 하고 추가하십시오.%APPDATA%\npm
- cmd를 다시여십시오.
%APPDATA%\npm
경로 끝이 아닌 경로 앞에 추가하십시오 .
전역으로 꿀꺽 꿀꺽 설치하십시오.
npm install -g gulp
프로젝트에서 로컬로 gulp를 설치하십시오.
npm install gulp
패키지에 아래 줄을 추가하십시오.
"scripts": { "gulp": "gulp" }
꿀꺽 꿀꺽
npm run gulp
이것은 나를 위해 일했습니다.
Windows 8.1을 사용하고 있습니다. 나는 같은 문제가 있었다.
Node.js 명령 프롬프트를 사용하여 gulp를 설치했습니다.
npm install -g gulp
Then go to the required directory in Node.js command prompt and try
gulp -v
If you get gulp local version not found exit the current Node.js command prompt and try the above command in a new Node.js command prompt
I tried the NODE_PATH mentioned by @SteveLacy but the command prompt was still not able to detect gulp command
Had the same problem, not really best solution but install it globally:
npm install -g gulp
Of course it's best to still have it in package.json
, so you can do the following to install it locally and add an entry into package.json
:
npm install --save-dev gulp
Everything else (gulp plugins) install also locally.
I was having the same problem when trying to get gulp working on a co-workers VM. It seems the problem stems from the users folder.
Adding NODE_PATH in my environment variables didn't fix the problem.
If you edit your 'Path' variable in your system variables and add '%APPDATA%\npm' at the end of that, it should fix the problem... Unless you or somebody else npm installed gulp as another user than the one you're currently logged in as.
If you want it to be available for all users, put 'C:\Users\yourUser\AppData\Roaming\npm'(or where ever you have gulp) explicitly instead of using '%APPDATA%\npm'. You can also move the files to a more user-indifferent path.
Don't forget to start a new cmd prompt, because the one you have open won't get the new 'Path' variable automatically.
Now 'gulp'.
The simple solution just do npm link gulp
One right way:
- Cmd + R : type "%appdata%"
- Go to npm folder
- Copy whole path like "C:\Users\Blah...\npm\"
- Go to My Computer + Right Click "Properties"
- Advanced System Settings (On the left)
- Click on Environment Variables
- Click on Edit Path
- Add that "C:\Users\Blah...\npm\" to the end and type ";" after that
- Click ok and reopen cmd
You should first install gulp
as global using:
npm install gulp -g
Otherwise the path solution will not resolve the problem.
Then add the npm modules path to the PATH using:
PATH = %PATH%;%APPDATA%\npm
Try to add to your PATH variable the following:
C:\Users\YOUR_USER\AppData\Roaming\npm
I had the same problem and I solved adding the path to my node modules.
I had a similar problem setting it up in windows 10. My answer is windows specific (look at the answers for modifying path in bash for a linux or OSX solution)
The core problem I had was that npm's folder was not registered in the path. I originally tried changing this in cmd prompt.
setx path "%path%;%appdata$\npm"
Note that I used setx instead of set to ensure that the update to the environmental variable remains. Also note that it's a backslash.
This should work but for me it didn't because setx has a limit of only accepting 1024 characters... (yes it's nonsensical to me as well).
So try the above and if you get a warning like did about reaching the 1024 limit, then you can do the other way I ended up doing.
First while youre still in the console, type: echo %appdata%\npm
... this is your npm folder that you want to add to the path so add it to your clipboard.
You have to go into the registry and reach the following folder:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
Then append the 'Path' value with the npm folder path in your clipboard. Reboot to activate the new value and you should now be good to go.
Finally, just test it all out
>npm install -g gulp
>gulp
This ended up being a 'user' issue with me. I had installed npm and node on the system logged in as user1, then I set-up user2. I could run node, and I could run npm commnds, but could not run any npm packages from the command line.
I uninstalled node and npm, and reinstalled under the correct user in order to solve the problem. After that I can run packages from the command-line without issue.
The top answer did not work for me.
I am using a virtual machine that had a previous owner. The previous owner had an old version of npm installed. Using that, I was installed gulp globally with npm install -g gulp
. Running the command gulp
would return 'gulp' is not recognized as an internal or external command, operable program or batch file.
. As I said, the top Answer did not fix my problem. I basically had to reinstall nodejs.
Solution
- Re-download nodejs
npm install -g gulp
gulp -version
This fixed the problem for me.
In my case it was that I had to install gulp-cli by command npm -g install gulp-cli
I had v0.12.3 of Nodejs on Win7 x64 and ran into similar issues when I tried installing gulp. This worked for me:
- Uninstalled Nodejs
- Installed Nodejs v0.10.29
- npm install -g npm
- npm install -g gulp
The NodeJS installer appears to add the user/AppData/Roaming/npm path to the user environment path, which is appropriate.
Normally, the PATH environment variable at the command line is the combination of the user environment path and the system environment path.
However, if the user environment path + the system environment path is larger than about 1920 characters, Windows does not not combine the user and system paths - only the system environment path is used.
See: https://stackoverflow.com/a/21270921/301152
So, when you open the Advanced System Settings in Windows to edit your environment variables, take a look to see if the user/AppData/Roaming/npm path is already in your user environment PATH. If it is, then the problem is that your user + system paths are too long, causing Windows to ignore your user path. Trim your user and/or system path strings and gulp should work as installed.
If you can't find anything to trim away from your user and system paths, then add the user/AppData/Roaming/npm path to the system environment path and call it a hack.
I was facing the same problem after installation. So i tried running cmd
with elevated privileges (admin) and it worked.
Screen capture:
Add this path in your Environment Variables PATH C:\Users\USERNAME\AppData\Roaming\npm\
This is most commonly because it is not found on environment variables as others have pointed out. This is what worked for me.
echo %PATH%
This will show you what's one your PATH environment variable. If node_modules is not there there do the following to add it from your APPDATA path.
PATH = %PATH%; %APPDATA%\npm
I already had the one condition from this answer (I don't know why)
https://stackoverflow.com/a/27295145/1175496
That is, my PATH already included %APPDATA%\npm
In my case, the problem was npm was not installing modules there (again, I don't know why)
Therefore I needed to do this:
$ npm config set prefix -g %APPDATA%/npm
After that, running $ npm install -g gulp
(or installing any other module) put the module in the place where PATH expects it.
This works for me:
npm link gulp
npm update
On my Windows 10 Enterprise, gulp was not installed in %AppData%, which is C:\Users\username\AppData\npm\node_modules on my machine, but in C:\Users\username\AppData\Local\npm\node_modules.
To get gulp to be picked up at the command prompt or in powershell, I added to the user PATH the value C:\Users\username\AppData\Local\npm. After that it worked like a charm. Naturally I had to close the command prompt or powershell window and re-open for the above to take effect.
Had gulp command not found problem in windows 10 and Adding "%AppData%\npm\node_modules" doesn't work for me. Do this steps please:
After doing
npm install -g npm
And
npm install -g gulp
Add
C:\Users\YourUsername\npm
to Path in System Variables.
It Works for me after all solutions failed me.
I resolved it by adding C:\Users\[USER]\AppData\Roaming\npm
to PATH
and not C:\Users\[USER]\AppData\Roaming\npm\node_modules
Run npm install gulp -g
if you are using windows, please add the gulp's dir to PATH.
such like C:\Users\YOURNAME\AppData\Roaming\npm\node_modules\gulp
In windows:
- Using your windows explorer, Navigate to your vagrant shared folder (I am using scotchbox by the way) e.g
C:\scotchbox/public/gulpProject
- In the address bar of the folder, type
cmd
and press Enter - Do your gulp installation
npm install
In short:
You should add %NODE_PATH%
to the system variable Path
if the other answers don't work.
The reason:
The point is, command prompt only executes programs under the Path
system variable, not the user variables. If you have NODE_PATH
set as a user variable, add %NODE_PATH%
to Path
.
I asked here and got marked duplicate for a question with different intention :(
NPM Windows doesn't execute program under the User Variable path [duplicate]
(Windows 10) I didn't like the path answers. I use choco package manager for node.js. Gulp would not fire for me unless it was:
Globally installed
npm i -g gulp
and local dirnpm i --save-dev gulp
The problem persisted beyond this once, which was fixed by completely removing node.js and reinstalling it.
I didn't see any comments about local/global and node.js removal/reinstall.
If you're on Windows and gulp is not recognized as an internal or external command, operable program or batch file try running gulp.js instead.
나는 라 라벨 프로젝트를 진행하고 있으며 로컬에서 꿀꺽 꿀꺽 마시고 있습니다. gulp.js에 오류 가있을 수 있으므로 Windows 명령 프롬프트 이외의 다른 것을 사용 하십시오 . Git bash 사용 하고 있으며 완벽하게 작동합니다.
참고 URL : https://stackoverflow.com/questions/24027551/gulp-command-not-found-error-after-installing-gulp
'IT story' 카테고리의 다른 글
파일 또는 어셈블리를로드 할 수 없습니다… 매개 변수가 잘못되었습니다 (0) | 2020.04.30 |
---|---|
v4 UUID를 생성하는 PHP 함수 (0) | 2020.04.30 |
소수점 이하 2 자리를 항상 표시하도록 소수점 이하 자릿수를 어떻게 지정할 수 있습니까? (0) | 2020.04.30 |
iTunes Connect 스크린 샷 모든 iOS (iPhone / iPad / Apple Watch) 장치의 크기 (0) | 2020.04.30 |
Linux 용 C ++ IDE? (0) | 2020.04.30 |