Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

Missing modules when running npm run build or npm install #780

Closed
tylerfoulkes opened this issue Mar 26, 2016 · 34 comments
Closed

Missing modules when running npm run build or npm install #780

tylerfoulkes opened this issue Mar 26, 2016 · 34 comments

Comments

@tylerfoulkes
Copy link

Hi,
I am working on a foundation press project and I am trying to get it all setup and working. I have cloned the preexisting repository howoever every time I run pretty much any npm command I get the following output:

foundationpress@2.3.0 build /path/to/foundation/project
gulp build

module.js:327
throw err;
^

Error: Cannot find module 'glob'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (/path/to/foundation/project/node_modules/gulp-load-plugins/node_modules/findup-sync/lib/findup-sync.js:15:12)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)

npm ERR! Darwin 15.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
npm ERR! node v4.4.1
npm ERR! npm v2.14.20
npm ERR! code ELIFECYCLE
npm ERR! foundationpress@2.3.0 build: gulp build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the foundationpress@2.3.0 build script 'gulp build'.
npm ERR! This is most likely a problem with the foundationpress package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! gulp build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs foundationpress
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls foundationpress
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /path/to/foundation/project/npm-debug.log

I have uninstalled nodeJS completely and reinstalled it again. It seems that I must have large dependency missing because every time I try to install the module that it says its missing it just complains about another module missing. Im a bit new to these package managers but aren't supposed to take care of all the dependencies?

  • Tyler
@colin-marshall
Copy link
Collaborator

Do you get errors when you run npm install?

@tylerfoulkes
Copy link
Author

@colin-marshall
Ya, npm install throws this error.

@colin-marshall
Copy link
Collaborator

The error in the original post is from running npm run build. I want to see the error from npm install

Please do the following:
rm -rf node_modules
npm install
provide the contents of that error message

Thanks.

@colin-marshall
Copy link
Collaborator

@tylerfoulkes did you figure it out?

@tylerfoulkes
Copy link
Author

Yes that worked perfect, thank you! Sorry I didn't respond earlier.

@colin-marshall
Copy link
Collaborator

No worries! Just making sure you got it sorted out. Feel free to close the issue if it's resolved. Thanks!

@clementcrownrise
Copy link

@colin-marshall , I am having the same error, I am using a windows 8 system, but it is as if the command rm -rf node_modules is not recorgnized on windows.

@venkatavinash
Copy link

@clementcrownrise , rm -rf is linux command to remove the directory i.e., node_modules in this case. You can try deleting node_modules and do "npm install" again. Hope it works!

@oranb83
Copy link

oranb83 commented Sep 14, 2016

if it doesn't work it could be a linking problem like I had. Try to uninstall npm and install it again, it should fix the problem.

@Desdichado
Copy link

In windows you could probably use rmdir /s node_modules instead of rm -rf node_modules.

@imsantosh
Copy link

i am facing same problem . i also uninstall and then install it ,but it is not working
getting below error:

module.js:428
throw err;
^

@chegior
Copy link

chegior commented Feb 24, 2017

Hi, I'm getting the same error on WINDOWS 10,

C:>node C:\Users\chegi\Documents\00 Soft Project\Test1.js
module.js:471
throw err;
^
I tried to run the npm install

and I got:

C:>npm install
npm WARN enoent ENOENT: no such file or directory, open 'C:\package.json'
npm WARN !invalid#1 No description
npm WARN !invalid#1 No repository field.
npm WARN !invalid#1 No README data
npm WARN !invalid#1 No license field.
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install"
npm ERR! node v6.10.0
npm ERR! npm v3.10.10
npm ERR! path C:\node_modules
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall mkdir

npm ERR! Error: EPERM: operation not permitted, mkdir 'C:\node_modules'
npm ERR! at Error (native)
npm ERR! { Error: EPERM: operation not permitted, mkdir 'C:\node_modules'
npm ERR! at Error (native)
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'mkdir',
npm ERR! path: 'C:\node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install"
npm ERR! node v6.10.0
npm ERR! npm v3.10.10
npm ERR! path C:\npm-debug.log.3072103967
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall open

npm ERR! Error: EPERM: operation not permitted, open 'C:\npm-debug.log.3072103967'
npm ERR! at Error (native)
npm ERR! { Error: EPERM: operation not permitted, open 'C:\npm-debug.log.3072103967'
npm ERR! at Error (native)
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'open',
npm ERR! path: 'C:\npm-debug.log.3072103967' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR! C:\npm-debug.log

C:>

Any suggestion how to fix this one, or If removing the modules may help, Thanks!!!

@Aravin
Copy link

Aravin commented May 26, 2017

I am also getting same error!

@yugensoft
Copy link

Firstly, npm on windows is just horrible. I know your pain.
Secondly, it's telling you what to do: npm ERR! Please try running this command again as root/Administrator
Open the cmd.exe with right click -> run as administrator

@dominicxowino
Copy link

having the same problem here.

@artigarg
Copy link

artigarg commented Aug 3, 2017

at npm install i did not get any error but after running on command promt i am geeting an error.

C:\Users\Lenovo\Desktop\sample website with node.js>node pcnmserver.js
module.js:471
throw err;
^
Error: Cannot find module 'C:\Users\Lenovo\Desktop\sample website with node.js\pcnmserver.js'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:389:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:504:3

@Katharsas
Copy link

Katharsas commented Aug 8, 2017

Same error after a completely fresh install of node, npm and node-sass on Win 10:

Edit: I solved it by updating to NPM 5.3.0. Seems to have been an npm problem.

[INFO] Running 'npm install --color=false' in C:\Users\---src\main\frontend
[ERROR] npm WARN prefer global node-gyp@3.6.2 sho`uld be installed with -g
[INFO] 
[INFO] > node-sass@4.5.3 install C:\Users\---\src\main\frontend\node_modules\node-sass
[INFO] > node scripts/install.js
[INFO] 
[ERROR] module.js:341
[ERROR]     throw err;
[ERROR]     ^
[ERROR] 
[ERROR] Error: Cannot find module 'extend'
[ERROR]     at Function.Module._resolveFilename (module.js:339:15)
[ERROR]     at Function.Module._load (module.js:290:25)
[ERROR]     at Module.require (module.js:367:17)
[ERROR]     at require (internal/module.js:20:19)
[ERROR]     at Object.<anonymous> (C:\Users\---\src\main\frontend\node_modules\request\index.js:17:29)
[ERROR]     at Module._compile (module.js:413:34)
[ERROR]     at Object.Module._extensions..js (module.js:422:10)
[ERROR]     at Module.load (module.js:357:32)
[ERROR]     at Function.Module._load (module.js:314:12)
[ERROR]     at Module.require (module.js:367:17)
[ERROR] npm WARN frontend No description
[ERROR] npm WARN frontend No repository field.
[ERROR] npm WARN frontend No license field.
[ERROR] 
[ERROR] npm ERR! code ELIFECYCLE
[ERROR] npm ERR! errno 1
[ERROR] npm ERR! node-sass@4.5.3 install: `node scripts/install.js`
[ERROR] npm ERR! Exit status 1
[ERROR] npm ERR! 
[ERROR] npm ERR! Failed at the node-sass@4.5.3 install script.
[ERROR] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[ERROR] 
[ERROR] npm ERR! A complete log of this run can be found in:
[ERROR] npm ERR!     C:\Users\---\AppData\Roaming\npm-cache\_logs\2017-08-08T11_02_46_858Z-debug.log

@zhangshichuan
Copy link

@colin-marshall thx

@dnorton94
Copy link

@artigarg did you troubleshoot this issue

I get a similar problem...

Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.

C:\WINDOWS\system32>node app.js
module.js:538
throw err;
^

Error: Cannot find module 'C:\WINDOWS\system32\app.js'
at Function.Module._resolveFilename (module.js:536:15)
at Function.Module._load (module.js:466:25)
at Function.Module.runMain (module.js:676:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3

C:\WINDOWS\system32>rimraf node_modules

C:\WINDOWS\system32>npm install
npm WARN saveError ENOENT: no such file or directory, open 'C:\WINDOWS\system32\package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open 'C:\WINDOWS\system32\package.json'
npm WARN system32 No description
npm WARN system32 No repository field.
npm WARN system32 No README data
npm WARN system32 No license field.

up to date in 0.284s

C:\WINDOWS\system32>node app.js
module.js:538
throw err;
^

Error: Cannot find module 'C:\WINDOWS\system32\app.js'
at Function.Module._resolveFilename (module.js:536:15)
at Function.Module._load (module.js:466:25)
at Function.Module.runMain (module.js:676:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3

C:\WINDOWS\system32>

@colin-marshall
Copy link
Collaborator

@dnorton94 are you even using FoundationPress? You don't build FoundationPress with node app.js which makes me think you using a completely different Node app.

Regardless, I think you are probably in the wrong directory if you are trying to run a Node app from the C:\WINDOWS\system32 directory. You need to be in the directory app.js is in.

@zhangshichuan
Copy link

@clementcrownrise Directly open the installed folder (node_modules). Right-click to remove it

@FlatspinZA
Copy link

BTW, chaps, for those of you who don't use Linux/Mac, just so you know - Windows has a huge problem with the deep file system created in node_modules & will very often refuse to remove the entire directory, even from PowerShell using Administrative privileges.

One solution is "Unlocker", but then people who aren't paying attention install other unnecessary applications on their PC, and the other irritation is that it often requires a system reboot to perform the operation.

In Windows 10, fortunately, we can install 'Windows Subsystem for Linux' via 'Control Panel >> Programs & Features >> Turn Windows Features On or Off'.

There is a tutorial on installation here: https://msdn.microsoft.com/en-us/commandline/wsl/install-win10, and afterwards users can then perform native Linux commands on their Windows folders using Bash from the Command Prompt, eliminating the need for pesky workarounds to delete files Windows battles with.

@Jay991
Copy link

Jay991 commented Dec 6, 2017

Hey guys, I'm on mac OS High Seirra and I'm trying to install solidity but i'm getting the below response. I tried runnig the command as sudo - same response.
I also tried running
rm -rf node_modules
npm install
Also did not work.

Here is the response I have been getting:

 ~ $sudo npm install -g solc
 Password:
 module.js:538
     throw err;
     ^

 Error: Cannot find module '../lib/utils/unsupported.js'
     at Function.Module._resolveFilename (module.js:536:15)
     at Function.Module._load (module.js:466:25)
     at Module.require (module.js:579:17)
     at require (internal/module.js:11:18)
     at /usr/local/lib/node_modules/npm/bin/npm-cli.js:19:21
     at Object.<anonymous> (/usr/local/lib/node_modules/npm/bin/npm-cli.js:92:3)
     at Module._compile (module.js:635:30)
     at Object.Module._extensions..js (module.js:646:10)
     at Module.load (module.js:554:32)
     at tryModuleLoad (module.js:497:12)

Any help to any solutions to this problem??
I also tried removing the modules all together - still same response.

@colin-marshall
Copy link
Collaborator

@Jay991 are you using FoundationPress?

@Jay991
Copy link

Jay991 commented Dec 6, 2017 via email

@ramjancse
Copy link

i just run this code
npm uninstall -g @angular/cli
npm cache clean
npm install -g @angular/cli@latest

@imsagarj
Copy link

module.js:538
throw err;
^

Error: Cannot find module 'bcrypt'
at Function.Module._resolveFilename (module.js:536:15)
at Function.Module._load (module.js:466:25)
at Module.require (module.js:579:17)
at require (internal/module.js:11:18)
at Object. (G:\codebase\calendercode1.1.0\server_side\controller\api\auth\auth.js:5:14)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Module.require (module.js:579:17)
at require (internal/module.js:11:18)
at Object. (G:\codebase\calendercode1.1.0\route.js:7:12)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)

plz give the solution for this ... I reinstall all npm package still this problem happens

@colin-marshall
Copy link
Collaborator

@imsagarj and everybody else that replies to this issue from here forward. Please state the following:

  • Node version
  • FoundationPress version

If you are not using FoundationPress, please do not look for help in this thread. https://github.com/npm/npm is a better place to get help on this issue. Thanks!

@uday-sai-kumar
Copy link

I getting this error, I didn't know how to figure it out
module.js:557
throw err;
^

Error: Cannot find module '/Users/udaysaikumar/connection'
at Function.Module._resolveFilename (module.js:555:15)
at Function.Module._load (module.js:482:25)
at Function.Module.runMain (module.js:701:10)
at startup (bootstrap_node.js:194:16)
at bootstrap_node.js:618:3

@khelmrab
Copy link

khelmrab commented Jan 17, 2018

i run build kibana
i update npm version 3.x to 4.6.1 working for me
the latest npm 5.x don't work

@colin-marshall
Copy link
Collaborator

@khelmrab @udaysaikumar1919 please see:
#780 (comment)

@avsingh999
Copy link

I think should install only LTS version of node

@anookeen
Copy link

image
I am getting this error. Help please.

@colin-marshall
Copy link
Collaborator

This issue keeps getting responses from people that aren't using FoundationPress, so I'm going to lock conversation since we can't help you with issues that aren't related FoundationPress.

There is one solution in this thread that seems to have helped a lot of people (delete node_modules and reinstall), so I'll leave it here to make sure it is seen:

rm -rf node_modules
npm install

If you are using FoundationPress and still have this issue, feel free to open a new one. For the rest of you, https://github.com/npm/npm is a better place to get help on the issue if the above solution does not work.

Repository owner locked as off-topic and limited conversation to collaborators Jan 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests