1 year ago

Require NPM package not found

Posted 1 year ago by maximus1127

I have a project that I'm trying to use a file system module in. I've "npm installed" 3 - fs, fs-extra, graceful-fs. I go into my resources/assets/app.js and add "require('fs')" to it (or any of the other two modules from my node_modules folder) and when i go to my console and run "npm run dev", it never recognizes the packages, thus I can't use the features. This is my first time trying to use NPM in laravel. Can someone help me know how to import and use these features. I have a pretty simple app so all of my javascript is in the footer of a blade view. It's so basic that I didn't even set it to a different file. But now I'm wanting to create a small text file in the project directory that I can save a very minimal amount of data to and then read later to make some programmatic decisions.

Please sign in or create an account to participate in this conversation.