13

I am trying to setup existing nodejs project on my window

Npm -v :- 6.0.1
node -v :- v8.11.1

When i run node app.js i am getting following error

include-all attempted to require(C:\xampp\htdocs\sails\backend\api\services\FileUploadService.js)`, but an error occurred:: Details:Error: Cannot find module 'internal/util/types' 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 evalmachine.:31:26 at Object. (C:\xampp\htdocs\sails\backend\node_modules\s3\node_modules\graceful-fs\fs.js:11:1) 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) at Module.require (module.js:596:17) at require (internal/module.js:11:18) at Object. (C:\xampp\htdocs\sails\backend\node_modules\s3\node_modules\graceful-fs\graceful-fs.js:3:27) 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) at Module.require (module.js:596:17) at require (internal/module.js:11:18) at Object. (C:\xampp\htdocs\sails\backend\node_modules\s3\lib\index.js:3:10)

Any idea? what i am missing

3 Answers 3

5

I had same issue. After researching it, it looks like there are many ways that people have fix this problem.

What caused the problem for me was that I upgraded node and needed to rebuild my project.

npm rebuild

Fixed it for me.

There is a lengthy discussion here: nodemon

Sign up to request clarification or add additional context in comments.

4 Comments

npm rebuild didn't help me.
this works for me, sudo n 6.12.0, it s the answer below
npm rebuild threw errors and didn't help. Instead, I followed the error stack of the command line and re-install every module it mentioned. And it worked.
you can use nvm and usually moving back and forth between npm versions should help
2

Reverting to an earlier version, resolved the crash I was getting each time I run npm :

sudo n 6.12.0

Thanks to: https://github.com/remy/nodemon/issues/1124#issuecomment-345181229

Comments

1

In Windows 10 I recently had error message also, running nodejs. This error would occur even if I simply ran something simple like npm --version.

I then noticed the error stack trace showed the following script in the call stack:

C:\Users\\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\fs.js:11:1)

It turns out that an earlier version of npm had installed scripts in the user's profile folder and, for some reason, that never got removed - even though I had performed many uninstalls and reinstalls of the latest nodejs version.

Simply removing the entire npm folder under C:\Users\<myusername>\AppData\Roaming\npm solved the issue.

The latest npm installs these scripts in C:\Program Files\nodejs\node_modules\npm, which is where these should be picked up.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.