简体   繁体   English

gulp - 错误:找不到模块“laravel-elixir”

[英]gulp - Error: Cannot find module 'laravel-elixir'

when i type in terminal in laravel dei project gulp always say当我在 laravel dei project gulp 中输入终端时总是说

module.js:549
throw err;
^
Error: Cannot find module 'laravel-elixir'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\xampp\htdocs\codehacking\gulpfile.js:1:76)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)

and try npm install and npm install --global gulp too并尝试npm installnpm install --global gulp

尝试在您的项目目录中手动安装 laravel-elixir。

npm install laravel-elixir --save-dev

If you encountered this problem "Cannot find module 'laravel-elixir'" I have a solution for you.如果您遇到这个问题“找不到模块‘laravel-elixir’”,我有一个解决方案。 Follow the commands below:请按照以下命令操作:

  • npm install node-sass@latest npm install node-sass@latest
  • npm uninstall laravel-elixir npm 卸载 laravel-elixir
  • npm uninstall session npm 卸载会话
  • npm install --save laravel-elixir npm install --save laravel-elixir
  • npm install --save session npm install --save 会话
  • gulp吞咽

I was getting the same error, I tried above solution and many other, did not work for me.我遇到了同样的错误,我尝试了上述解决方案和许多其他解决方案,但对我不起作用。 Following two commands fixed my error.以下两个命令修复了我的错误。

npm install --global --production windows-build-tools

npm install node-gyp

The complete solution is on the following link: https://catalin.me/how-to-fix-node-js-gyp-err-cant-find-python-executable-python-on-windows/完整的解决方案在以下链接上: https : //catalin.me/how-to-fix-node-js-gyp-err-cant-find-python-executable-python-on-windows/

My OS is windows.我的操作系统是windows。

Then in my Laravel 5.2 on the root of project I ran following command然后在我的 Laravel 5.2 项目根目录中,我运行了以下命令

npm install

Then I ran gulp command然后我运行了 gulp 命令

gulp

gulp started working: Gulp Command Image gulp 开始工作:Gulp 命令图像Gulp 命令图像

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM