0

I have been experiencing with this issue, since i install composer perfectly and then requiring laravel/valet globally.

When I hit

'valet' on iterm/zsh 

what returns is as below.

module.js:540
   throw err;
   ^
Error: Cannot find module './node_modules/coffee-script'
   at Function.Module._resolveFilename (module.js:538:15)
   at Function.Module._load (module.js:468:25)
   at Module.require (module.js:587:17)
   at require (internal/module.js:11:18)
   at Object.<anonymous> (/usr/local/lib/node_modules/valet. /node_modules/express.io/switch.js:5:5)
   at Module._compile (module.js:643:30)
   at Object.Module._extensions..js (module.js:654:10)
   at Module.load (module.js:556:32)
   at tryModuleLoad (module.js:499:12)
   at Function.Module._load (module.js:491:3)

I also tried to:

npm i coffee-script
npm i coffeescript 

nothing works.

I don't know what code I should I share with you.

halfer
  • 19,824
  • 17
  • 99
  • 186
  • Try running `npm i coffee-script` (notice the typo fix) – JasonK Mar 07 '18 at 10:13
  • @JasonK made a typo there, thx for letting me know. – Kaan KÜÇÜK Mar 07 '18 at 10:43
  • still not working, – Kaan KÜÇÜK Mar 07 '18 at 11:36
  • Can you confirm that the module is actually installed? Check for errors during installation and check if the `node_modules/coffee-script` folder exists. – JasonK Mar 07 '18 at 11:40
  • Please read [Under what circumstances may I add “urgent” or other similar phrases to my question, in order to obtain faster answers?](//meta.stackoverflow.com/q/326569) - the summary is that this is not an ideal way to address volunteers, and is probably counterproductive to obtaining answers. Please refrain from adding this to your questions. – halfer Mar 07 '18 at 12:55
  • @JasonK hey, Under `/Users/kaankucuk/System/vendor/laravel` and `/Users/kaankucuk/System/vendor/laravel/valet` ı have two node_modules folder with both coffeescript and coffee-script, they both have package-lock.json I think i am missing something at this point. – Kaan KÜÇÜK Mar 07 '18 at 15:26

2 Answers2

0

It seems like you installed the node modules within the folder of the composer package laravel/valet. You should run the npm i coffee-script command from the root directory of your Laravel project. Another option is to run npm i coffee-script -g to install coffeescript as a global dependency.

JasonK
  • 5,214
  • 9
  • 33
  • 61
0

I followed the path on error thrown by npm and deleted node_modules folder.

Afterwards valet install worked.

Thank you for your time.