Git bash though error while run npm packages - node.js

While I am running any project in my git bash it's showing the following error:
ionic -v
module.js:471
throw err;
^
Error: Cannot find module 'C:\Program Files\Git\node_modules\ionic\bin\ionic'
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:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3
So I am not able to run the project and also it create a sh.exe.stackdump file in my project. I am not sure what the problem is. Please anyone help to find out the solution.

After cloning a repo you should run :
npm install
in your git root folder to install npm dependencies before being able to run the app.

Related

Problems running npm with node to increase memory

I have an Ubuntu docker container that has npm installed using nvm. In order to compile my code I am trying to run:
node --max_old_space_size=4096 npm run build
But I get:
root#faf3418e77d0:/myproject# node --max_old_space_size=4096 npm run build
module.js:538
throw err;
^
Error: Cannot find module '/myproject/npm'
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
root#faf3418e77d0:/myproject#
I have npm so I do not understand how this is happening. I can run npm from any folder at my docker container. Any ideas?
Using the command: which npm
I found where it is located and used that complete info in my script.
Thx

create-react-app does not work

i am trying to start with a react project and i installed create-react-app with npm.
When i do the command create-react-app pseudogram i get the following error:
Aborting installation.
Unexpected error. Please report it as a bug:
{ Error: Cannot find module 'C:\Users\leonel\Desktop\pseudogram\node_modules\react-scripts\package.json'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at checkNodeVersion (C:\Users\leonel\AppData\Roaming\npm\node_modules\create-react-app\createReactApp.js:476:23)
at getPackageName.then.then.then.packageName (C:\Users\leonel\AppData\Roaming\npm\node_modules\create-react-app\createReactApp.js:283:7)
at process._tickCallback (internal/process/next_tick.js:109:7) code: 'MODULE_NOT_FOUND' }
I tried with different versions of node and npm and still does not work.
Thanks in advance
$ npm i -g create-react-app . Install it globally.
After that, in your terminal, type $ create-react-app name-of-the-app , then $ cd name-of-the-app and finally $ npm start.
The documentation will print automatically after it finishes installing.

NPM module.js:472

When I try to start any npm command, the terminal displays
module.js:472
throw err;
^
Error: Cannot find module '/usr/lib/node_modules/npm/bin/node_modules/npm/bin/npm-cli.js'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:425:7)
at startup (bootstrap_node.js:146:9)
at bootstrap_node.js:540:3
I tried to reinstall node.js and npm.
How and where can I change the directory "usr/lib/node_modules/npm/bin/node_modules/npm/bin/npm-cli.js" to "usr/bin/node_modules/npm/bin/npm-cli.js".
p.s. When I copy all node_modules and past to /node_modules/npm/bin/, it works, but this is not an acceptable solution.
In you project folder there is a file named webpack.local.settings.js.sample. Rename the file to webpack.local.settings.js It worked for me.

npm install -g cordova, npm install -g ionic on Windows10

I was trying to do push notifications using angular and ionic, i was getting few issues while i was running Command prompt.
So i had to uninstall node.js and i tried to re-install the node.js , it installed successfully as i verified by node -v then it showed me v4.4.2
Then i tried to install cordova, ionic by using following commands:
npm install -g cordova
npm install -g ionic
it throwed following errors:
module.js:327
throw err;
^
Error: Cannot find module 'C:\Program Files\nodejs\node_modules\npm\bin\node_modules\npm\bin\npm-cli.js'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:139:18)
at node.js:968:3
module.js:327
throw err;
^
Error: Cannot find module 'C:\Program Files\nodejs\node_modules\npm\bin\node_modules\npm\bin\npm-cli.js'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:139:18)
at node.js:968:3
Can someone help me how to resolve this issue, as i tried multiple times and restarted my pc.cordova issue
Please check the attached image for the reference and let me know what changes / how to resolve this issue

Node.js not searching modules in node_modules folder

I have installed packages using npm install -g http-server.
However, when i try to run this using node http-server. it throws error as below:
module.js:338
throw err;
^
Error: Cannot find module '/home/khagesh/http-server'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
I have tried setting NODE_PATH to /home/khagesh/npm/lib/node_modules.
As far as i can think is that node is not searching modules in node_modules and directly searching in user directory.
I am running it on Ubuntu 14.04.
Any help to fix this issue is appreciated.

Resources