I cant run ionic serve - node.js

Can somebody help me? I'm new in ionic. When I try to run serve, this error appears. I ran sudo npm install -g cordova, but the error came back.
Error: Cannot find module 'xmlbuilder'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/usr/local/lib/node_modules/ionic/node_modules/xml2js/lib/xml2js.js:12:13)
at Object. (/usr/local/lib/node_modules/ionic/node_modules/xml2js/lib/xml2js.js:436:4)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)

Try removing them and reinstalling
npm cache clean
npm uninstall -g cordova ionic
npm install -g cordova ionic
Use sudo if you are on a mac or a linux.

are you sure you're in the project directory? As in assuming you created your app on the desktop, are you sure you're not in C://Users/username/Desktop instead of C://Users/username/Desktop/myApp ?

Related

Express not working with node 9.x

I have an Ubuntu box with node - v 9.5.0 and npm - 5.6.0 versions. I am trying to use expressjs (http://expressjs.com), but unable to run it. It works fine for node v 4.x.x.
$ express -h
module.js:557
throw err;
^
Error: Cannot find module 'commander'
at Function.Module._resolveFilename (module.js:555:15)
at Function.Module._load (module.js:482:25)
at Module.require (module.js:604:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/usr/lib/nodejs/express-generator/bin/express:3:15)
at Module._compile (module.js:660:30)
at Object.Module._extensions..js (module.js:671:10)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
at Function.Module._load (module.js:505:3)
What is it that I am missing here?
Ubuntu's packages seem to be outdated.
Installing using apt-get node-express-generator gives this error.
Installing using npm i -g express-generator works fine.
Please try to follow the preceding steps.
Install the current version of NodeJS
Uninstall all modules with npm uninstall and rm -fr ~/.npm
Reinstall express-generator
Hope it helps.

Gulp watch not working - cannot find module connect

Trying to run my project using gulp (havent used gulp before and have inherited an exisiting project).
I install the dependencies into the wordpress theme directory.
Running gulp watch throws this error:
Error: Cannot find module 'connect'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (C:\dev\projects\romac-website\web\app\themes\romac\node_modules\browser-sync\lib\utils.js:307:31)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
I have tried to update npm but not sure if it is fine or the problem (still).
I also tried to ins install this module with npm -g install connect
What should I try next?
Try deleting the node-modules folder then reinstall npm install connect --save-dev Then retry running gulp

Removed npmlog folder and now I can't use npm

I'm a beginner in linux and npm in general, at first I screwed my npm installation by doing this :
npm conig set prefix usr/bin/env
I really don't know what I was really doing here, but then I got an EExist error whenever I run npm .
I decided to remove npm and node via :
sudo apt-get remove npm
sudo apt-get remove node
And the reinstalled them normally via the apt-get command . I had the same error, so I did a very immature thing and I deleted all folder containing the word npm, and more importantly npmlog, uninstlled and reinstalled node and npm via apt .
Now I'm having this error that I couldn't fix whenevr I use the npm command .
module.js:340
throw err;
^
Error: Cannot find module 'npmlog'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at /usr/share/npm/bin/npm-cli.js:18:11
at Object.<anonymous> (/usr/share/npm/bin/npm-cli.js:86:3)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
I tried reinstalling, removing other npm folders in node_modules, but none of those techniques worked for me, please how can I fix this ?

error cannot find module 'umask'

I just installed nodejs x64 on my Windows 10 computer. I keep all default config,
I open cmd and type:
npm -v
Then i got following error:
module.js:457
throw err;
^
Error: Cannot find module 'umask'
at Function.Module._resolveFilename (module.js:455:15)
at Function.Module._load (module.js:403:25)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Users\W10-PRO\AppData\Roaming\npm\node_module\npm\lib\utils\umask.js:1:75)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
Every command start with "npm" create this error and npm cannot uninstall, update itself)
Please help me fix this error?
update your npm
$ npm install npm -g
I would try to update/install NPM
$ npm update -g npm
I know the answer!
Uninstall nodejs.
Delete all references to npm and nodejs (Program Files, Program Files(x86).
Then also delete those in AppData/Roaming (npm and npm-cache to be sure).
Reinstall nodejs.
It works!

node.js returns "Cannot find module 'lockit-mongodb-adapter'"

I am going through my first node.js project. I've installed lockit , have a app.js file, and when I try to run it I get this error
module.js:340
throw err;
^ Error: Cannot find module 'lockit-mongodb-adapter'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at new module.exports (C:\Users\xx\Documents\mailer\index.js:38:44)
at Object.<anonymous> (C:\Users\xx\Documents\mailer\examples\mongodb\app. js:32:14)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
I am quite certain I have lockit-mongodb-adapter installed.
You need to install the module. Cd to the root of your app directory and run this command and make sure lockit-mongodb-adapter is in your node modules directory.
npm install lockit-mongodb-adapter
Another thing you can do if you are certain it is installed is double check to see what is installed by running this command:
npm list
And this one to see what is installed globally:
npm list -g
Update:
I was able to reproduce the issue you where having. And to resolve it I deleted the module from the node moules directory. And re-installed with the following command:
npm install lockit-mongodb-adapter -save
It now shows up in npm list with no issues:

Resources